I_PT_SAFTGenLedgerCustomer

DDL: I_PT_SAFTGENLEDGERCUSTOMER SQL: IPTSAFTGLCUST Type: view COMPOSITE Package: GLO_FIN_IS_SAFT_PT

SAF-T PT Gen Ledger Customer

I_PT_SAFTGenLedgerCustomer is a Composite CDS View that provides data about "SAF-T PT Gen Ledger Customer" in SAP S/4HANA. It reads from 3 data sources (I_PT_SAFTIsAlternateAccount, I_PT_SAFTAcctgDocCustAddrHist, I_PT_AcctgDocDgtlSgntr) and exposes 17 fields with key fields CompanyCode, FiscalYear, AccountingDocument, Ledger. It has 2 associations to related views. Part of development package GLO_FIN_IS_SAFT_PT.

Data Sources (3)

SourceAliasJoin Type
I_PT_SAFTIsAlternateAccount c inner
I_PT_SAFTAcctgDocCustAddrHist h left_outer
I_PT_AcctgDocDgtlSgntr s left_outer

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_PT_SAFTGenericSettings _b _b.CompanyCode = a.CompanyCode and _b.FiscalYearFrom <= a.FiscalYear and _b.FiscalYearTo >= a.FiscalYear and _b.SourceLedger = a.Ledger
[0..1] I_SAFTCustTaxRegnNmbr _CustLand a.Customer = _CustLand.CustomerNum

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName IPTSAFTGLCUST view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
EndUserText.label SAF-T PT Gen Ledger Customer view

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode a CompanyCode Receiver Company Code
KEY FiscalYear a FiscalYear G/L Fiscal Year
KEY AccountingDocument a AccountingDocument Journal Entry
KEY Ledger a Ledger Ledger
_CompanyCode a _CompanyCode
_FiscalYear a _FiscalYear
_JournalEntry a _JournalEntry
_Ledger a _Ledger
PostingDateendasDocumentDate
CompanyNameendasCompanyName
PostalCodeelse0000000endendasPostalCode
CountryelseDesconhecidoendendasCountry
Customer a Customer Sold-to Party
PhoneNumberendasPhoneNumber
FaxNumberendasFaxNumber
EmailAddressendasEmailAddress
SearchURLAddressendasWebsiteURL

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_SAFTGenLedgerCustomer.
-- 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: IPTSAFTGLCUST

CREATE VIEW I_PT_SAFTGenLedgerCustomer AS
SELECT
  a.CompanyCode AS CompanyCode,
  a.FiscalYear AS FiscalYear,
  a.AccountingDocument AS AccountingDocument,
  a.Ledger AS Ledger,
  a._CompanyCode AS _CompanyCode,
  a._FiscalYear AS _FiscalYear,
  a._JournalEntry AS _JournalEntry,
  a._Ledger AS _Ledger,
  case when s.PortugueseInvoiceDate is not initial then s.PortugueseInvoiceDate else a.PostingDate end as DocumentDate AS PostingDateendasDocumentDate,
  case when s.PortugueseInvoiceNumber is initial or s.PortugueseInvoiceNumber is null then cast(case when a.BusinessPartnerName1 is not initial and a.BusinessPartnerName2 is not initial then concat_with_space(a.BusinessPartnerName1,a.BusinessPartnerName2,1) when a.BusinessPartnerName1 is not initial then a.BusinessPartnerName1 when a.BusinessPartnerName2 is not initial then a.BusinessPartnerName2 end as bu_name1tx) else h.CompanyName end as CompanyName AS CompanyNameendasCompanyName,
  case when s.PortugueseInvoiceNumber is initial or s.PortugueseInvoiceNumber is null then case when a.PostalCode is not initial then a.PostalCode else '0000-000' end when s.PortugueseInvoiceNumber is not initial then case when h.PostalCode is not initial then h.PostalCode else '0000-000' end end as PostalCode AS PostalCodeelse0000000endendasPostalCode,
  case when s.PortugueseInvoiceNumber is initial or s.PortugueseInvoiceNumber is null then case when a.Country is not initial then a.Country else 'Desconhecido' end when s.PortugueseInvoiceNumber is not initial then case when h.Country is not initial then h.Country else 'Desconhecido' end end as Country AS CountryelseDesconhecidoendendasCountry,
  a.Customer AS Customer,
  case when s.PortugueseInvoiceNumber is initial or s.PortugueseInvoiceNumber is null then coalesce ( a._AddressRepresentation._PhoneNumber[ 1: PhNmbrIsCurrentOverallDefault = 'X' ].InternationalPhoneNumber , '' ) else coalesce ( h.PhoneNumber, '' ) end as PhoneNumber AS PhoneNumberendasPhoneNumber,
  case when s.PortugueseInvoiceNumber is initial or s.PortugueseInvoiceNumber is null then coalesce ( a._AddressRepresentation._FaxNumber[ 1: FaxNumberIsCurrentDefault = 'X' ].InternationalFaxNumber , '') else coalesce ( h.FaxNumber , '' ) end as FaxNumber AS FaxNumberendasFaxNumber,
  case when s.PortugueseInvoiceNumber is initial or s.PortugueseInvoiceNumber is null then coalesce ( a._AddressRepresentation._EmailAddress[ 1: EmailAddressIsCurrentDefault = 'X' ].EmailAddress , '' ) else coalesce( h.EmailAddress , '' ) end as EmailAddress AS EmailAddressendasEmailAddress,
  case when s.PortugueseInvoiceNumber is initial or s.PortugueseInvoiceNumber is null then ' ' else coalesce ( h.SearchURLAddress , '' ) end as WebsiteURL AS SearchURLAddressendasWebsiteURL
INNER JOIN I_PT_SAFTIsAlternateAccount AS c ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PT_AcctgDocDgtlSgntr AS s ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PT_SAFTAcctgDocCustAddrHist AS h ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PT_SAFTGenericSettings AS _b ON _b.CompanyCode = a.CompanyCode AND _b.FiscalYearFrom <= a.FiscalYear AND _b.FiscalYearTo >= a.FiscalYear AND _b.SourceLedger = a.Ledger  -- association [0..1]
LEFT OUTER JOIN I_SAFTCustTaxRegnNmbr AS _CustLand ON a.Customer = _CustLand.CustomerNum  -- association [0..1]
;