P_PL_SAFTInvoiceFileHeading

DDL: P_PL_SAFTINVOICEFILEHEADING SQL: PPLSAFTINVFILEH Type: view CONSUMPTION

P_PL_SAFTInvoiceFileHeading is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (I_CompanyCode, I_PL_SAFTGeneralSettings) and exposes 19 fields with key field CompanyCode.

Data Sources (2)

SourceAliasJoin Type
I_CompanyCode Company from
I_PL_SAFTGeneralSettings Settings inner

Parameters (2)

NameTypeDefault
P_StartDate datum
P_EndDate datum

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PPLSAFTINVFILEH view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #P view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_CompanyCode CompanyCode
BusinessPartnerName41asCompanyName
HouseNumber1asCompanyCodeAddress
RegionNameendasRegion
CityName
PostalCode
StreetName
HouseNumber
HouseNumberSupplementText
PhoneNumber
HomeCityNameendasHomeCityName
CompanyVATRegistration
EmailAddress I_PL_SAFTGeneralSettings EmailAddress
PL_TaxOfficeCode I_PL_SAFTGeneralSettings PL_TaxOfficeCode
PL_CompanyDistrictName I_PL_SAFTGeneralSettings PL_CompanyDistrictName
PL_CompanySubDistrictName I_PL_SAFTGeneralSettings PL_CompanySubDistrictName
CompanyCodeCurrency I_CompanyCode Currency
Country I_CompanyCode Country
_Currency _Currency
@AbapCatalog.sqlViewName: 'PPLSAFTINVFILEH'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass:  #MIXED
@ObjectModel.usageType.serviceQuality: #P
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_PL_SAFTInvoiceFileHeading
  with parameters
    P_StartDate : datum,
    P_EndDate   : datum
  as select from I_CompanyCode            as Company
    inner join   I_PL_SAFTGeneralSettings as Settings on  Settings.CompanyCode       = Company.CompanyCode
                                                      and Settings.ValidityEndDate   >= $parameters.P_StartDate
                                                      and Settings.ValidityStartDate <= $parameters.P_EndDate
{
  key Company.CompanyCode,

      concat_with_space( concat_with_space( concat_with_space(
        Company._Address.BusinessPartnerName1,
        Company._Address.BusinessPartnerName2, 1),
        Company._Address.BusinessPartnerName3, 1),
        Company._Address.BusinessPartnerName4, 1)          as CompanyName,

      concat_with_space(concat_with_space(concat_with_space(
        Company._Address.CityName,
        Company._Address.PostalCode, 1),
        Company._Address.StreetName, 1),
        Company._Address.HouseNumber, 1)                   as CompanyCodeAddress,

      case
       when Company._Address.Region  is initial
       then 'Nie dotyczy'
       else  Company._Address._Region._RegionText[1: Language = 'L'].RegionName
      end                                                  as Region,
      Company._Address.CityName                            as CityName,
      Company._Address.PostalCode                          as PostalCode,
      Company._Address.StreetName                          as StreetName,
      Company._Address.HouseNumber                         as HouseNumber,
      Company._Address.HouseNumberSupplementText           as HouseNumberSupplementText,
      Company._Address.PhoneNumber                         as PhoneNumber,
      case
        when Company._Address.HomeCityName is initial
        then Company._Address.CityName
        else Company._Address.HomeCityName
      end                                                  as HomeCityName,
      
      replace(Company.VATRegistration, Company.Country,'') as CompanyVATRegistration,

      Settings.EmailAddress,
      Settings.PL_TaxOfficeCode,
      Settings.PL_CompanyDistrictName,
      Settings.PL_CompanySubDistrictName,

      Company.Currency                                     as CompanyCodeCurrency,
      Company.Country,

      _Currency
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ADDRESS",
"I_COMPANYCODE",
"I_PL_SAFTGENERALSETTINGS",
"I_REGION",
"I_REGIONTEXT"
],
"ASSOCIATED":
[
"I_CURRENCY"
],
"BASE":
[
"I_COMPANYCODE"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/