I_PT_GenLedgerBPMasterData

DDL: I_PT_GENLEDGERBPMASTERDATA Type: view_entity COMPOSITE

SAFT PT BP for Master Data

I_PT_GenLedgerBPMasterData is a Composite CDS View that provides data about "SAFT PT BP for Master Data" in SAP S/4HANA. It reads from 3 data sources (P_PT_BusinessPartner_Delivery, I_OperationalAcctgDocItem, I_PT_SAFTGenericSettings) and exposes 23 fields with key fields CompanyCode, FiscalYear, AccountingDocument, AccountingDocumentItem, char32asBusinessPartnerCustomer. It has 1 association to related views.

Data Sources (3)

SourceAliasJoin Type
P_PT_BusinessPartner_Delivery CustInfo inner
I_OperationalAcctgDocItem Document from
I_PT_SAFTGenericSettings GenericSettings inner

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_PT_SAFTAcctgDocCustAddrHist _CustHist _CustHist.AccountingDocument = Document.AccountingDocument and _CustHist.CompanyCode = Document.CompanyCode and _CustHist.FiscalYear = Document.FiscalYear and _CustHist.Customer = Document.Customer

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
EndUserText.label SAFT PT BP for Master Data view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #MIXED view

Fields (23)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_OperationalAcctgDocItem CompanyCode Receiver Company Code
KEY FiscalYear I_OperationalAcctgDocItem FiscalYear G/L Fiscal Year
KEY AccountingDocument I_OperationalAcctgDocItem AccountingDocument Journal Entry
KEY AccountingDocumentItem I_OperationalAcctgDocItem AccountingDocumentItem Posting View Item
KEY char32asBusinessPartnerCustomer
Customer I_OperationalAcctgDocItem Customer Sold-to Party
Supplier I_OperationalAcctgDocItem Supplier Supplier
char32asSupplierToPartner
DelivOfGoodsDestCountry P_PT_BusinessPartner_Delivery DelivOfGoodsDestCountry Dest. C/R
IsOneTimeAccountendasIsOneTimeAccount
AddressIDendendasAddressID
BPSupplierNameendendasCompanyName
CustomerSupplierAddress
CityNameendendasCityName
PostalCodeendendasPostalCode
CountryendendasCountry
_CompanyCode I_OperationalAcctgDocItem _CompanyCode
_FiscalYear I_OperationalAcctgDocItem _FiscalYear
_JournalEntry I_OperationalAcctgDocItem _JournalEntry
_Supplier I_OperationalAcctgDocItem _Supplier
_Customer I_OperationalAcctgDocItem _Customer
_CustHist _CustHist
_JournalEntryItemOneTimeData I_OperationalAcctgDocItem _JournalEntryItemOneTimeData

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_GenLedgerBPMasterData.
-- 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_GenLedgerBPMasterData AS
SELECT
  Document.CompanyCode AS CompanyCode,
  Document.FiscalYear AS FiscalYear,
  Document.AccountingDocument AS AccountingDocument,
  Document.AccountingDocumentItem AS AccountingDocumentItem,
  cast (case when Document.Customer is not initial then case Document._Customer.IsOneTimeAccount when 'X' then case when Document._JournalEntryItemOneTimeData.TaxID1 is not initial then concat(Document.Customer, concat('/', Document._JournalEntryItemOneTimeData.TaxID1 )) else case when Document.VATRegistration is initial or Document.VATRegistration is null then concat(Document.Customer, concat('/', '999999990')) else concat(Document.Customer, concat('/', substring(Document.VATRegistration ,3,18))) end end else case when _CustHist.PortugueseCustomerWithVersion is not initial then case when CustInfo.DelivOfGoodsDestCountry is not initial then case when CustInfo.DelivOfGoodsDestCountry != Document._Customer.Country then concat(_CustHist.PortugueseCustomerWithVersion,concat('/',CustInfo.DelivOfGoodsDestCountry)) else _CustHist.PortugueseCustomerWithVersion end else _CustHist.PortugueseCustomerWithVersion end when Document.Customer is not initial then case when CustInfo.DelivOfGoodsDestCountry is not initial then case when CustInfo.DelivOfGoodsDestCountry != Document._Customer.Country then concat(Document.Customer,concat('/',CustInfo.DelivOfGoodsDestCountry)) else Document.Customer end else Document.Customer end end end end as abap.char(32) ) as BusinessPartnerCustomer AS char32asBusinessPartnerCustomer,
  Document.Customer AS Customer,
  Document.Supplier AS Supplier,
  cast( case when Document.Supplier is not initial then case Document._Supplier.IsOneTimeAccount when 'X' then case when Document.VATRegistration is initial or Document.VATRegistration is null then case when Document._JournalEntryItemOneTimeData.TaxID1 is not initial then concat(Document.Supplier,concat('/', Document._JournalEntryItemOneTimeData.TaxID1)) else concat(Document.Supplier, concat('/','999999990')) end else concat(Document.Supplier,concat('/',substring(Document.VATRegistration ,3,18))) end else case when CustInfo.DelivOfGoodsDestCountry is not initial then case when CustInfo.DelivOfGoodsDestCountry != Document._Supplier.Country then concat(Document.Supplier,concat('/',CustInfo.DelivOfGoodsDestCountry)) else Document.Supplier end else Document.Supplier end end end as abap.char(32) ) as SupplierToPartner AS char32asSupplierToPartner,
  CustInfo.DelivOfGoodsDestCountry AS DelivOfGoodsDestCountry,
  case when Document.Customer is not initial then Document._Customer.IsOneTimeAccount else Document._Supplier.IsOneTimeAccount end as IsOneTimeAccount AS IsOneTimeAccountendasIsOneTimeAccount,
  case IsOneTimeAccount when 'X' then Document._JournalEntryItemOneTimeData.AddressID else case when Document.Customer is not initial then Document._Customer.AddressID else Document._Supplier.AddressID end end as AddressID AS AddressIDendendasAddressID,
  case when Document.Customer is not initial then case IsOneTimeAccount when 'X' then concat_with_space(Document._JournalEntryItemOneTimeData.BusinessPartnerName1, Document._JournalEntryItemOneTimeData.BusinessPartnerName2, 1) else case when _CustHist.Customer is not initial then _CustHist.CompanyName else concat_with_space(Document._Customer.BusinessPartnerName1, Document._Customer.BusinessPartnerName2, 1) end end else case IsOneTimeAccount when 'X' then concat_with_space(Document._JournalEntryItemOneTimeData.BusinessPartnerName1, Document._JournalEntryItemOneTimeData.BusinessPartnerName2, 1) else Document._Supplier.BPSupplierName end end as CompanyName AS BPSupplierNameendendasCompanyName,
  cast(' ' as adrnr) AS CustomerSupplierAddress,
  case when Document.Customer is not initial then case IsOneTimeAccount when 'X' then Document._JournalEntryItemOneTimeData.CityName else case when _CustHist.Customer is not initial then _CustHist.CityName else Document._Customer.CityName end end else case IsOneTimeAccount when 'X' then Document._JournalEntryItemOneTimeData.CityName else Document._Supplier.CityName end end as CityName AS CityNameendendasCityName,
  case when Document.Customer is not initial then case IsOneTimeAccount when 'X' then Document._JournalEntryItemOneTimeData.PostalCode else case when _CustHist.Customer is not initial then _CustHist.PostalCode else Document._Customer.PostalCode end end else case IsOneTimeAccount when 'X' then Document._JournalEntryItemOneTimeData.PostalCode else Document._Supplier.PostalCode end end as PostalCode AS PostalCodeendendasPostalCode,
  case when Document.Customer is not initial then case IsOneTimeAccount when 'X' then Document._JournalEntryItemOneTimeData.Country else case when _CustHist.Customer is not initial then _CustHist.Country else Document._Customer.Country end end else case IsOneTimeAccount when 'X' then Document._JournalEntryItemOneTimeData.Country else Document._Supplier.Country end end as Country AS CountryendendasCountry,
  Document._CompanyCode AS _CompanyCode,
  Document._FiscalYear AS _FiscalYear,
  Document._JournalEntry AS _JournalEntry,
  Document._Supplier AS _Supplier,
  Document._Customer AS _Customer,
  Document._JournalEntryItemOneTimeData AS _JournalEntryItemOneTimeData
FROM I_OperationalAcctgDocItem AS Document
INNER JOIN I_PT_SAFTGenericSettings AS GenericSettings ON /* join condition not captured in parsed metadata */
INNER JOIN P_PT_BusinessPartner_Delivery AS CustInfo ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PT_SAFTAcctgDocCustAddrHist AS _CustHist ON _CustHist.AccountingDocument = Document.AccountingDocument AND _CustHist.CompanyCode = Document.CompanyCode AND _CustHist.FiscalYear = Document.FiscalYear AND _CustHist.Customer = Document.Customer  -- association [0..1]
;