P_PL_SAFTInvoiceFileHeading

DDL: P_PL_SAFTINVOICEFILEHEADING SQL: PPLSAFTINVFILEH Type: view CONSUMPTION Package: GLO_FIN_IS_SAFT_PL

SAF-T PL Invoice File Heading data

P_PL_SAFTInvoiceFileHeading is a Consumption CDS View that provides data about "SAF-T PL Invoice File Heading data" in SAP S/4HANA. It reads from 2 data sources (I_CompanyCode, I_PL_SAFTGeneralSettings) and exposes 15 fields with key field CompanyCode. Part of development package GLO_FIN_IS_SAFT_PL.

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 (15)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_CompanyCode CompanyCode Receiver Company Code
AddresseeFullNameendasCompanyName
CityName1endasCompanyCodeAddress
RegionNameendendelseendasRegion
StreetNameendasStreetName
HouseNumberendasHouseNumber
CityNameendasHomeCityName
PostalCodeendasPostalCode
CityName
PhoneNumber
EmailAddress I_PL_SAFTGeneralSettings EmailAddress E-Mail Address
PL_TaxOfficeCode I_PL_SAFTGeneralSettings PL_TaxOfficeCode Tax Office Code
CompanyCodeCurrency I_CompanyCode Currency Valuation Crcy
Country I_CompanyCode Country Venue: Ctry/Reg
_Currency _Currency

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_PL_SAFTInvoiceFileHeading.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PPLSAFTINVFILEH
-- Parameters: P_StartDate : datum, P_EndDate : datum

CREATE VIEW P_PL_SAFTInvoiceFileHeading AS
SELECT
  Company.CompanyCode AS CompanyCode,
  case when Company.Country = 'PL' then concat_with_space( concat_with_space( concat_with_space( Company._Address.BusinessPartnerName1, Company._Address.BusinessPartnerName2, 1), Company._Address.BusinessPartnerName3, 1), Company._Address.BusinessPartnerName4, 1) else P_PL_SAFTCoCodeCountry._Address.AddresseeFullName end as CompanyName AS AddresseeFullNameendasCompanyName,
  case when Company.Country = 'PL' then concat_with_space(concat_with_space(concat_with_space( Company._Address.StreetName, Company._Address.HouseNumber, 1), Company._Address.PostalCode, 1), Company._Address.CityName, 1) else concat_with_space(concat_with_space(concat_with_space( P_PL_SAFTCoCodeCountry._Address.StreetName, P_PL_SAFTCoCodeCountry._Address.HouseNumber, 1), P_PL_SAFTCoCodeCountry._Address.PostalCode, 1), P_PL_SAFTCoCodeCountry._Address.CityName, 1) end as CompanyCodeAddress AS CityName1endasCompanyCodeAddress,
  case when Company.Country = 'PL' then case when Company._Address.Region is initial then 'Nie dotyczy' else case when Company._Address._Region._RegionText[1: Language = 'L'].RegionName is not initial then Company._Address._Region._RegionText[1: Language = 'L'].RegionName when Company._Address._Region._RegionText[1: Language = 'L'].RegionName is initial then Company._Address._Region._RegionText[1: Language = $session.system_language].RegionName else Company._Address._Region._RegionText[1: Language = 'E'].RegionName end end when P_PL_SAFTCoCodeCountry._Address.Country = 'PL' then case when P_PL_SAFTCoCodeCountry._Address.Region is initial then 'Nie dotyczy' else case when P_PL_SAFTCoCodeCountry._Address._Region._RegionText[1: Language = 'L'].RegionName is not initial then P_PL_SAFTCoCodeCountry._Address._Region._RegionText[1: Language = 'L'].RegionName when P_PL_SAFTCoCodeCountry._Address._Region._RegionText[1: Language = 'L'].RegionName is initial then P_PL_SAFTCoCodeCountry._Address._Region._RegionText[1: Language = $session.system_language].RegionName else P_PL_SAFTCoCodeCountry._Address._Region._RegionText[1: Language = 'E'].RegionName end end else '' end as Region AS RegionNameendendelseendasRegion,
  case when Company.Country = 'PL' then Company._Address.StreetName when Company.Country <> 'PL' then P_PL_SAFTCoCodeCountry._Address.StreetName end as StreetName AS StreetNameendasStreetName,
  case when Company.Country = 'PL' then Company._Address.HouseNumber when Company.Country <> 'PL' then P_PL_SAFTCoCodeCountry._Address.HouseNumber end as HouseNumber AS HouseNumberendasHouseNumber,
  case when Company.Country = 'PL' then case when Company._Address.HomeCityName is initial then Company._Address.CityName else Company._Address.HomeCityName end when Company.Country <> 'PL' then P_PL_SAFTCoCodeCountry._Address.CityName end as HomeCityName AS CityNameendasHomeCityName,
  case when Company.Country = 'PL' then Company._Address.PostalCode when Company.Country <> 'PL' then P_PL_SAFTCoCodeCountry._Address.PostalCode end as PostalCode AS PostalCodeendasPostalCode,
  Company._Address.CityName AS CityName,
  Company._Address.PhoneNumber AS PhoneNumber,
  Settings.EmailAddress AS EmailAddress,
  Settings.PL_TaxOfficeCode AS PL_TaxOfficeCode,
  Company.Currency AS CompanyCodeCurrency,
  Company.Country AS Country
FROM I_CompanyCode AS Company
INNER JOIN I_PL_SAFTGeneralSettings AS Settings ON /* join condition not captured in parsed metadata */
;