I_PT_SAFTDeliveryCustomer is a Composite CDS View that provides data about "SAF-T PT Delivery Customer" in SAP S/4HANA. It reads from 2 data sources (I_SAFTDeliveryCustomer, I_PT_DeliveryDgtlSgntr) and exposes 14 fields with key fields CompanyCode, PortugueseDeliveryNumber. It has 3 associations to related views.
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_SAFTDeliveryCustomer.-- 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: IPTSAFTDELCUSTCREATE VIEW I_PT_SAFTDeliveryCustomer ASSELECT
s.CompanyCode AS CompanyCode,
s.PortugueseDeliveryNumber AS PortugueseDeliveryNumber,
s.DeliveryDocument AS DeliveryDocument,
s.DeliveryDate AS DocumentDate,
s.PortugueseDigitalSignatureDate AS CreationDate,
s.PortugueseDigitalSignatureTime AS CreationTime,
casewhen h.PortugueseCustomerWithVersion isnot initial then h.Customer else a.Customer endas Customer AS CustomerendasCustomer,
casewhen h.PortugueseCustomerWithVersion isnot initial thencast (h.CompanyName as bu_name1tx) elsecast (a._ShipToParty.CustomerName as bu_name1tx) endas CompanyName AS CustomerNameasbu_name1txendasCompanyName,
casewhen h.PortugueseCustomerWithVersion isnot initial then coalesce(h.CustomerSupplierAddress, 'Desconhecido') else coalesce(a._ShipToParty.StreetName, 'Desconhecido') endas StreetName AS StreetNameDesconhecidoendasStreetName,
casewhen h.PortugueseCustomerWithVersion isnot initial then coalesce(h.PostalCode, '0000-000') else coalesce(a._ShipToParty.PostalCode, '0000-000') endas PostalCode AS PostalCode0000000endasPostalCode,
casewhen h.PortugueseCustomerWithVersion isnot initial then coalesce ( h.PhoneNumber, '' ) else coalesce ( a._ShipToParty._StandardAddress.PhoneNumber, '' ) endas PhoneNumber AS PhoneNumberendasPhoneNumber,
casewhen h.PortugueseCustomerWithVersion isnot initial then coalesce ( h.FaxNumber, '' ) else coalesce ( a._ShipToParty.FaxNumber, '' ) endas FaxNumber AS FaxNumberendasFaxNumber,
casewhen h.PortugueseCustomerWithVersion isnot initial then coalesce ( h.EmailAddress, '' ) else coalesce ( a._ShipToParty._StandardAddress._DefaultCorpEmailAddress.EmailAddress, '' ) endas EmailAddress AS EmailAddressendasEmailAddress,
casewhen h.PortugueseCustomerWithVersion isnot initial then coalesce ( h.SearchURLAddress, '' ) else coalesce ( a._ShipToParty._StandardAddress._DefaultCorpURLAddress.SearchURLAddress, '' ) endas WebsiteURL AS SearchURLAddressendasWebsiteURL
FROM I_SAFTDeliveryCustomer AS a
INNERJOIN I_PT_DeliveryDgtlSgntr AS s ON /* join condition not captured in parsed metadata */
LEFTOUTERJOIN I_PT_DelDocCustAddrHist AS h ON a.DeliveryDocument = h.DeliveryDocument AND a.CompanyCode = h.CompanyCode AND a.Customer = h.Customer -- association [0..1]LEFTOUTERJOIN I_SAFTCustTaxRegnNmbr AS _CustLand ON a.Customer = _CustLand.CustomerNum AND a.Country = _CustLand.Country -- association [0..1]LEFTOUTERJOIN I_CustomerContactOP AS _CustomerContact ON h.Customer = _CustomerContact.Customer -- association [0..*]
;