P_ID_AcctDocBusinessPartner is a Composite CDS View that provides data about "BP information for ID VAT CoreTax" in SAP S/4HANA. It reads from 1 data source (I_OperationalAcctgDocItem) and exposes 23 fields with key fields CompanyCode, FiscalYear, AccountingDocument. Part of development package GLO_FIN_IS_VAT_ID.
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_ID_AcctDocBusinessPartner.-- 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.-- Parameters: P_CompanyCode : fis_bukrs, P_FromFiscalYear : gjahr, P_ToFiscalYear : gjahrCREATE VIEW P_ID_AcctDocBusinessPartner ASSELECT
CompanyCode,
FiscalYear,
AccountingDocument,
max(casewhen Customer isnotnullthen Customer else '' end) AS Customer,
max(casewhen Supplier isnotnullthen Supplier else '' end) AS Supplier,
max(casewhen BusinessPlace isnotnullthen BusinessPlace else '' end) AS BusinessPlace,
max(casewhen BillingDocument isnotnullthen BillingDocument else '' end) AS BillingDocument,
max(casewhen SpecialGLCode isnotnullthen SpecialGLCode else '' end) AS SpecialGLCode,
max(casewhen IsNegativePosting isnotnullthen IsNegativePosting else '' end) AS IsNegativePosting,
max(casewhen _OneTimeAccountBP.Country isnotnullthen _OneTimeAccountBP.Country elsecasewhen _Customer.Country isnotnullthen _Customer.Country else _Supplier.Country endend) AS ActiveCountry,
cast(max(casewhen _Customer._CustomerToBusinessPartner._BusinessPartner.PersonNumber isnotnullthen _Customer._CustomerToBusinessPartner._BusinessPartner.PersonNumber else _Supplier._SupplierToBusinessPartner._BusinessPartner.PersonNumber end ) as ad_persnum) AS PersonNumber,
max(casewhen _OneTimeAccountBP.TaxID1 isnotnullthen _OneTimeAccountBP.TaxID1 else '' end) AS TaxID1,
max(casewhen _OneTimeAccountBP.TaxID2 isnotnullthen _OneTimeAccountBP.TaxID2 else '' end) AS TaxID2,
max(casewhen _OneTimeAccountBP.TaxID3 isnotnullthen _OneTimeAccountBP.TaxID3 else '' end) AS TaxID3,
max(casewhen _OneTimeAccountBP.TaxID5 isnotnullthen _OneTimeAccountBP.TaxID5 else '' end) AS TaxID5,
max(casewhen _OneTimeAccountBP.BusinessPartnerName1 isnotnullthen _OneTimeAccountBP.BusinessPartnerName1 else '' end) AS BusinessPartnerName1,
max(casewhen _OneTimeAccountBP.BusinessPartnerName2 isnotnullthen _OneTimeAccountBP.BusinessPartnerName2 else '' end) AS BusinessPartnerName2,
max(casewhen _OneTimeAccountBP.BusinessPartnerName3 isnotnullthen _OneTimeAccountBP.BusinessPartnerName3 else '' end) AS BusinessPartnerName3,
max(casewhen _OneTimeAccountBP.BusinessPartnerName4 isnotnullthen _OneTimeAccountBP.BusinessPartnerName4 else '' end) AS BusinessPartnerName4,
max(casewhen _OneTimeAccountBP.StreetAddressName isnotnullthen _OneTimeAccountBP.StreetAddressName else '' end) AS StreetAddressName,
max(casewhen _OneTimeAccountBP.CityName isnotnullthen _OneTimeAccountBP.CityName else '' end) AS CityName,
max(casewhen _OneTimeAccountBP.Country isnotnullthen _OneTimeAccountBP.Country else '' end) AS Country,
max(casewhen _OneTimeAccountBP.PostalCode isnotnullthen _OneTimeAccountBP.PostalCode else '' end) AS PostalCode
FROM I_OperationalAcctgDocItem
;