Deprecated
This CDS view is deprecated in S/4HANA. View all deprecated CDS views →

C_PL_SAFTInvoiceCnsldtnHeader

DDL: C_PL_SAFTINVOICECNSLDTNHEADER SQL: CPLSAFTINVOICEH Type: view CONSUMPTION

SAF-T Invoice Consolidation Header

C_PL_SAFTInvoiceCnsldtnHeader is a Consumption CDS View that provides data about "SAF-T Invoice Consolidation Header" in SAP S/4HANA. It reads from 2 data sources (I_PL_SAFTInvoiceHeader, I_SAFTConsolidationKey) and exposes 60 fields with key fields SAFTConsolidationUUID, Currency.

Data Sources (2)

SourceAliasJoin Type
I_PL_SAFTInvoiceHeader Invoice_header from
I_SAFTConsolidationKey saftn_consolidation inner

Parameters (1)

NameTypeDefault
P_StatutoryReportVersion fibrrptg_layout_version_de

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName CPLSAFTINVOICEH view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
EndUserText.label SAF-T Invoice Consolidation Header view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.lifecycle.status #DEPRECATED view

Fields (60)

KeyFieldSource TableSource FieldDescription
KEY SAFTConsolidationUUID I_SAFTConsolidationKey SAFTConsolidationUUID Consolidation ID
KEY Currency Currency Valuation Crcy
FiscalYear FiscalYear G/L Fiscal Year
AccountingDocument AccountingDocument Journal Entry
CompanyCode CompanyCode Receiver Company Code
DeliveryDate DeliveryDate Delivery Date
EmailAddress EmailAddress E-Mail Address
LocalTaxOffice LocalTaxOffice Tax Office Code
District District District Court
CompanyRegion CompanyRegion Region
Municipality Municipality Venue Municplty
BusinessPartnerName41endasFullName
HouseNumber1endasCustomerSupplierAddress
InvoiceDocumentNumber InvoiceDocumentNumber Inv.Number
IsEUTriangularDeal IsEUTriangularDeal Is EU Triangular Deal
IsReversed IsReversed Reversed?
SDDocumentReasonText SDDocumentReasonText Description
CountryelseendasCustomerSupplierCountry
Customer Customer Sold-to Party
Supplier Supplier Supplier
SourceDocument SourceDocument Document
DocumentDate DocumentDate Journal Entry Date
PostingDate PostingDate Posting Date for GR
DocumentType DocumentType Order Type
AccountingDocumentItem AccountingDocumentItem Posting View Item
PL_SAFTNetAmount10 PL_SAFTNetAmount10 P_13_1
PL_SAFTTaxAmount16 PL_SAFTTaxAmount16 P_14_1
PL_SAFTNetAmount11 PL_SAFTNetAmount11 P_13_2
PL_SAFTTaxAmount18 PL_SAFTTaxAmount18 P_14_2
PL_SAFTNetAmount12 PL_SAFTNetAmount12 P_13_3
PL_SAFTTaxAmount20 PL_SAFTTaxAmount20 P_14_3
PL_SAFTNetAmount13 PL_SAFTNetAmount13 P_13_4
PL_SAFTTaxAmount24 PL_SAFTTaxAmount24 P_14_4
PL_SAFTNetAmount14 PL_SAFTNetAmount14 P_13_4
PL_SAFTTaxAmount26 PL_SAFTTaxAmount26 P_14_5
PL_SAFTNetAmount15 PL_SAFTNetAmount15 P_13_6
PL_SAFTNetAmount17 PL_SAFTNetAmount17 P_13_4
TotalAmountInTransactionCrcy TotalAmountInTransactionCrcy Total Amt In Tr Crcy
ReasonCode ReasonCode Reason Code
BusinessPartnerName41asCompanyName
HouseNumber1asCompanyCodeAddress
RegionendasRegion
CityName
PostalCode
StreetName
HouseNumber
HomeCityNameendasHomeCityName
HouseNumberSupplementText
CompanyVATRegistration _CompanyCode VATRegistration VAT Registration No.
ReportingVATRegistration
CompanyCodeCurrency _CompanyCode Currency Valuation Crcy
CountryelseendasCountry
PL_SAFTHighRateTxAmtInLoclCrcy PL_SAFTHighRateTxAmtInLoclCrcy P_14_1W
PL_SAFTMdmRateTxAmtInLoclCrcy PL_SAFTMdmRateTxAmtInLoclCrcy P_14_2W
PL_SAFTLowRateTxAmtInLoclCrcy PL_SAFTLowRateTxAmtInLoclCrcy P_14_3W
PL_SAFTOthRateTxAmtInLoclCrcy PL_SAFTOthRateTxAmtInLoclCrcy P_14_4W
PL_SAFTInvoiceHasSplitPayment PL_SAFTInvoiceHasSplitPayment
PL_SAFTDownPaymentPrevInvcsTxt PL_SAFTDownPaymentPrevInvcsTxt Prev. Invoices DP
SalesDocument SalesDocument SD Document
TotalGrossAmount TotalGrossAmount Total Gross Amount

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 C_PL_SAFTInvoiceCnsldtnHeader.
-- 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: CPLSAFTINVOICEH
-- Parameters: P_StatutoryReportVersion : fibrrptg_layout_version_de

CREATE VIEW C_PL_SAFTInvoiceCnsldtnHeader AS
SELECT
  saftn_consolidation.SAFTConsolidationUUID AS SAFTConsolidationUUID,
  Currency,
  FiscalYear,
  AccountingDocument,
  CompanyCode,
  DeliveryDate,
  EmailAddress,
  LocalTaxOffice,
  District,
  CompanyRegion,
  Municipality,
  case when _OneTimeAccount.BusinessPartnerName1 is not initial then concat_with_space(concat_with_space(concat_with_space(_OneTimeAccount.BusinessPartnerName1,_OneTimeAccount.BusinessPartnerName2, 1), _OneTimeAccount.BusinessPartnerName3,1),_OneTimeAccount.BusinessPartnerName4,1) when Customer is not initial then concat(concat(concat_with_space(_Customer._StandardAddress.BusinessPartnerName1,_Customer._StandardAddress.BusinessPartnerName2, 1), _Customer._StandardAddress.BusinessPartnerName3),_Customer._StandardAddress.BusinessPartnerName4) else concat_with_space(concat_with_space(concat_with_space(_Supplier._StandardAddress.BusinessPartnerName1,_Supplier._StandardAddress.BusinessPartnerName2, 1), _Supplier._StandardAddress.BusinessPartnerName3,1),_Supplier._StandardAddress.BusinessPartnerName4,1) end as FullName AS BusinessPartnerName41endasFullName,
  case when _OneTimeAccount.BusinessPartnerName1 is not initial then concat(concat_with_space(_OneTimeAccount.CityName,_OneTimeAccount.PostalCode, 1), _OneTimeAccount.StreetAddressName) when Customer is not initial then concat_with_space(concat_with_space(concat_with_space(_Customer._StandardAddress.CityName,_Customer._StandardAddress.PostalCode, 1), _Customer._StandardAddress.StreetName,1),_Customer._StandardAddress.HouseNumber,1) else concat_with_space(concat_with_space(concat_with_space(_Supplier._StandardAddress.CityName,_Supplier._StandardAddress.PostalCode, 1), _Supplier._StandardAddress.StreetName,1),_Supplier._StandardAddress.HouseNumber,1) end as CustomerSupplierAddress AS HouseNumber1endasCustomerSupplierAddress,
  InvoiceDocumentNumber,
  IsEUTriangularDeal,
  IsReversed,
  SDDocumentReasonText,
  case when _OneTimeAccount.Country is not initial and ( _OneTimeAccount.Country = 'AT' or _OneTimeAccount.Country = 'BE' or _OneTimeAccount.Country = 'BG' or _OneTimeAccount.Country = 'CY' or _OneTimeAccount.Country = 'CZ' or _OneTimeAccount.Country = 'DE' or _OneTimeAccount.Country = 'DK' or _OneTimeAccount.Country = 'EE' or _OneTimeAccount.Country = 'ES' or _OneTimeAccount.Country = 'FI' or _OneTimeAccount.Country = 'FR' or _OneTimeAccount.Country = 'GB' or _OneTimeAccount.Country = 'GR' or _OneTimeAccount.Country = 'HU' or _OneTimeAccount.Country = 'IE' or _OneTimeAccount.Country = 'IT' or _OneTimeAccount.Country = 'LT' or _OneTimeAccount.Country = 'LU' or _OneTimeAccount.Country = 'LV' or _OneTimeAccount.Country = 'MF' or _OneTimeAccount.Country = 'MT' or _OneTimeAccount.Country = 'NL' or _OneTimeAccount.Country = 'PT' or _OneTimeAccount.Country = 'RO' or _OneTimeAccount.Country = 'SE' or _OneTimeAccount.Country = 'SI' or _OneTimeAccount.Country = 'SK' ) then _OneTimeAccount.Country when _Customer.Country is not initial and ( _Customer.Country = 'AT' or _Customer.Country = 'BE' or _Customer.Country = 'BG' or _Customer.Country = 'CY' or _Customer.Country = 'CZ' or _Customer.Country = 'DE' or _Customer.Country = 'DK' or _Customer.Country = 'EE' or _Customer.Country = 'ES' or _Customer.Country = 'FI' or _Customer.Country = 'FR' or _Customer.Country = 'GB' or _Customer.Country = 'GR' or _Customer.Country = 'HU' or _Customer.Country = 'IE' or _Customer.Country = 'IT' or _Customer.Country = 'LT' or _Customer.Country = 'LU' or _Customer.Country = 'LV' or _Customer.Country = 'MF' or _Customer.Country = 'MT' or _Customer.Country = 'NL' or _Customer.Country = 'PT' or _Customer.Country = 'RO' or _Customer.Country = 'SE' or _Customer.Country = 'SI' or _Customer.Country = 'SK' ) then _Customer.Country when _Supplier.Country is not initial and ( _Supplier.Country = 'AT' or _Supplier.Country = 'BE' or _Supplier.Country = 'BG' or _Supplier.Country = 'CY' or _Supplier.Country = 'CZ' or _Supplier.Country = 'DE' or _Supplier.Country = 'DK' or _Supplier.Country = 'EE' or _Supplier.Country = 'ES' or _Supplier.Country = 'FI' or _Supplier.Country = 'FR' or _Supplier.Country = 'GB' or _Supplier.Country = 'GR' or _Supplier.Country = 'HU' or _Supplier.Country = 'IE' or _Supplier.Country = 'IT' or _Supplier.Country = 'LT' or _Supplier.Country = 'LU' or _Supplier.Country = 'LV' or _Supplier.Country = 'MF' or _Supplier.Country = 'MT' or _Supplier.Country = 'NL' or _Supplier.Country = 'PT' or _Supplier.Country = 'RO' or _Supplier.Country = 'SE' or _Supplier.Country = 'SI' or _Supplier.Country = 'SK' ) then _Supplier.Country else '' end as CustomerSupplierCountry AS CountryelseendasCustomerSupplierCountry,
  Customer,
  Supplier,
  SourceDocument,
  DocumentDate,
  PostingDate,
  DocumentType,
  AccountingDocumentItem,
  PL_SAFTNetAmount10,
  PL_SAFTTaxAmount16,
  PL_SAFTNetAmount11,
  PL_SAFTTaxAmount18,
  PL_SAFTNetAmount12,
  PL_SAFTTaxAmount20,
  PL_SAFTNetAmount13,
  PL_SAFTTaxAmount24,
  PL_SAFTNetAmount14,
  PL_SAFTTaxAmount26,
  PL_SAFTNetAmount15,
  PL_SAFTNetAmount17,
  TotalAmountInTransactionCrcy,
  ReasonCode,
  concat_with_space(concat_with_space(concat_with_space(_CompanyCode._Address.BusinessPartnerName1,_CompanyCode._Address.BusinessPartnerName2, 1), _CompanyCode._Address.BusinessPartnerName3,1),_CompanyCode._Address.BusinessPartnerName4,1) as CompanyName AS BusinessPartnerName41asCompanyName,
  concat_with_space(concat_with_space(concat_with_space(_CompanyCode._Address.CityName,_CompanyCode._Address.PostalCode, 1), _CompanyCode._Address.StreetName,1),_CompanyCode._Address.HouseNumber,1) as CompanyCodeAddress AS HouseNumber1asCompanyCodeAddress,
  case when _CompanyCode._Address.Region is initial then 'Nie dotyczy' else _CompanyCode._Address.Region end as Region AS RegionendasRegion,
  _CompanyCode._Address.CityName AS CityName,
  _CompanyCode._Address.PostalCode AS PostalCode,
  _CompanyCode._Address.StreetName AS StreetName,
  _CompanyCode._Address.HouseNumber AS HouseNumber,
  case when _CompanyCode._Address.HomeCityName is initial then _CompanyCode._Address.CityName else _CompanyCode._Address.HomeCityName end as HomeCityName AS HomeCityNameendasHomeCityName,
  _CompanyCode._Address.HouseNumberSupplementText AS HouseNumberSupplementText,
  _CompanyCode.VATRegistration AS CompanyVATRegistration,
  replace(_CompanyCode.VATRegistration, 'PL', '') AS ReportingVATRegistration,
  _CompanyCode.Currency AS CompanyCodeCurrency,
  case when _OneTimeAccount.Country is not initial and ( _OneTimeAccount.Country = 'AT' or _OneTimeAccount.Country = 'BE' or _OneTimeAccount.Country = 'BG' or _OneTimeAccount.Country = 'CY' or _OneTimeAccount.Country = 'CZ' or _OneTimeAccount.Country = 'DE' or _OneTimeAccount.Country = 'DK' or _OneTimeAccount.Country = 'EE' or _OneTimeAccount.Country = 'ES' or _OneTimeAccount.Country = 'FI' or _OneTimeAccount.Country = 'FR' or _OneTimeAccount.Country = 'GB' or _OneTimeAccount.Country = 'GR' or _OneTimeAccount.Country = 'HU' or _OneTimeAccount.Country = 'IE' or _OneTimeAccount.Country = 'IT' or _OneTimeAccount.Country = 'LT' or _OneTimeAccount.Country = 'LU' or _OneTimeAccount.Country = 'LV' or _OneTimeAccount.Country = 'MF' or _OneTimeAccount.Country = 'MT' or _OneTimeAccount.Country = 'NL' or _OneTimeAccount.Country = 'PT' or _OneTimeAccount.Country = 'RO' or _OneTimeAccount.Country = 'SE' or _OneTimeAccount.Country = 'SI' or _OneTimeAccount.Country = 'SK' ) then _CompanyCode.Country when _Customer.Country is not initial and ( _Customer.Country = 'AT' or _Customer.Country = 'BE' or _Customer.Country = 'BG' or _Customer.Country = 'CY' or _Customer.Country = 'CZ' or _Customer.Country = 'DE' or _Customer.Country = 'DK' or _Customer.Country = 'EE' or _Customer.Country = 'ES' or _Customer.Country = 'FI' or _Customer.Country = 'FR' or _Customer.Country = 'GB' or _Customer.Country = 'GR' or _Customer.Country = 'HU' or _Customer.Country = 'IE' or _Customer.Country = 'IT' or _Customer.Country = 'LT' or _Customer.Country = 'LU' or _Customer.Country = 'LV' or _Customer.Country = 'MF' or _Customer.Country = 'MT' or _Customer.Country = 'NL' or _Customer.Country = 'PT' or _Customer.Country = 'RO' or _Customer.Country = 'SE' or _Customer.Country = 'SI' or _Customer.Country = 'SK' ) then _CompanyCode.Country when _Supplier.Country is not initial and ( _Supplier.Country = 'AT' or _Supplier.Country = 'BE' or _Supplier.Country = 'BG' or _Supplier.Country = 'CY' or _Supplier.Country = 'CZ' or _Supplier.Country = 'DE' or _Supplier.Country = 'DK' or _Supplier.Country = 'EE' or _Supplier.Country = 'ES' or _Supplier.Country = 'FI' or _Supplier.Country = 'FR' or _Supplier.Country = 'GB' or _Supplier.Country = 'GR' or _Supplier.Country = 'HU' or _Supplier.Country = 'IE' or _Supplier.Country = 'IT' or _Supplier.Country = 'LT' or _Supplier.Country = 'LU' or _Supplier.Country = 'LV' or _Supplier.Country = 'MF' or _Supplier.Country = 'MT' or _Supplier.Country = 'NL' or _Supplier.Country = 'PT' or _Supplier.Country = 'RO' or _Supplier.Country = 'SE' or _Supplier.Country = 'SI' or _Supplier.Country = 'SK' ) then _CompanyCode.Country else '' end as Country AS CountryelseendasCountry,
  PL_SAFTHighRateTxAmtInLoclCrcy,
  PL_SAFTMdmRateTxAmtInLoclCrcy,
  PL_SAFTLowRateTxAmtInLoclCrcy,
  PL_SAFTOthRateTxAmtInLoclCrcy,
  PL_SAFTInvoiceHasSplitPayment,
  PL_SAFTDownPaymentPrevInvcsTxt,
  SalesDocument,
  TotalGrossAmount
FROM I_PL_SAFTInvoiceHeader AS Invoice_header
INNER JOIN I_SAFTConsolidationKey AS saftn_consolidation ON /* join condition not captured in parsed metadata */
;