I_PT_SAFTCustomerSalesInvoice

DDL: I_PT_SAFTCUSTOMERSALESINVOICE Type: view_entity COMPOSITE

Customer from Billing Document

I_PT_SAFTCustomerSalesInvoice is a Composite CDS View that provides data about "Customer from Billing Document" in SAP S/4HANA. It reads from 4 data sources (I_Customer, I_BillingDocument, I_PT_SAFTBillgDocCustAddrHist, I_PT_BillgDocDgtlSgntr) and exposes 4 fields with key fields CompanyCode, PortugueseInvoiceNumber, DocumentDate, char30asBusinessPartnerCustomer. It has 1 association to related views.

Data Sources (4)

SourceAliasJoin Type
I_Customer Cust inner
I_BillingDocument Doc inner
I_PT_SAFTBillgDocCustAddrHist Hist inner
I_PT_BillgDocDgtlSgntr Sig from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_SAFTCustTaxRegnNmbr _CustLand Doc.PayerParty = _CustLand.CustomerNum and Doc.VATRegistrationCountry = _CustLand.Country

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
VDM.viewType #COMPOSITE view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
EndUserText.label Customer from Billing Document view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_PT_BillgDocDgtlSgntr CompanyCode Receiver Company Code
KEY PortugueseInvoiceNumber I_PT_BillgDocDgtlSgntr PortugueseInvoiceNumber
KEY DocumentDate I_BillingDocument BillingDocumentDate Billing Date
KEY char30asBusinessPartnerCustomer

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 I_PT_SAFTCustomerSalesInvoice.
-- 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.

CREATE VIEW I_PT_SAFTCustomerSalesInvoice AS
SELECT
  Sig.CompanyCode AS CompanyCode,
  Sig.PortugueseInvoiceNumber AS PortugueseInvoiceNumber,
  Doc.BillingDocumentDate AS DocumentDate,
  cast(case when _CustLand.Country is not initial then case when Doc.VATRegistrationCountry is not initial then concat(Hist.PortugueseCustomerWithVersion, concat('/', Doc.VATRegistrationCountry )) else concat(Hist.PortugueseCustomerWithVersion, concat('/', Hist.Country)) end else case when Hist.Country != Cust.Country then concat(Hist.PortugueseCustomerWithVersion,concat('/',Hist.Country)) else Hist.PortugueseCustomerWithVersion end end as abap.char(30)) as BusinessPartnerCustomer AS char30asBusinessPartnerCustomer
FROM I_PT_BillgDocDgtlSgntr AS Sig
INNER JOIN I_BillingDocument AS Doc ON /* join condition not captured in parsed metadata */
INNER JOIN I_Customer AS Cust ON /* join condition not captured in parsed metadata */
INNER JOIN I_PT_SAFTBillgDocCustAddrHist AS Hist ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_SAFTCustTaxRegnNmbr AS _CustLand ON Doc.PayerParty = _CustLand.CustomerNum AND Doc.VATRegistrationCountry = _CustLand.Country  -- association [0..1]
;