P_PL_SAFTInvcHeaderBscVersion2

DDL: P_PL_SAFTINVCHEADERBSCVERSION2 Type: view_entity COMPOSITE

P_PL_SAFTInvcHeaderBscVersion2 is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_JournalEntry, I_OperationalAcctgDocItem, P_PL_SAFTINVOICETAXD) and exposes 28 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 1 association to related views.

Data Sources (3)

SourceAliasJoin Type
I_JournalEntry Entry from
I_OperationalAcctgDocItem Item inner
P_PL_SAFTINVOICETAXD Tax inner

Parameters (2)

NameTypeDefault
P_StartDate datum
P_EndDate datum

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_JournalEntryItemOneTimeData _OneTimeAccountBP $projection.CompanyCode = _OneTimeAccountBP.CompanyCode and $projection.FiscalYear = _OneTimeAccountBP.FiscalYear and $projection.AccountingDocument = _OneTimeAccountBP.AccountingDocument and $projection.AccountingDocumentItem = _OneTimeAccountBP.AccountingDocumentItem

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.serviceQuality #P view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view

Fields (28)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode Receiver Company Code
KEY AccountingDocument I_JournalEntry AccountingDocument Journal Entry
KEY FiscalYear I_JournalEntry FiscalYear G/L Fiscal Year
KEY AccountingDocumentItem
BusinessTransactionType I_JournalEntry BusinessTransactionType Bus.transaction
TaxReportingDate I_JournalEntry TaxReportingDate Tax Reporting Date
PostingDate I_JournalEntry PostingDate Posting Date for GR
DocumentDate I_JournalEntry DocumentDate Journal Entry Date
ReferenceDocumentType I_JournalEntry ReferenceDocumentType Reference Document Type
TransactionCurrency I_JournalEntry TransactionCurrency Transaction Currency
CompanyCodeCurrency I_JournalEntry CompanyCodeCurrency Local Currency
DocumentReferenceID I_JournalEntry DocumentReferenceID Reference
AlternativeReferenceDocument I_JournalEntry AlternativeReferenceDocument Alternative Reference Document
Customer I_OperationalAcctgDocItem Customer Sold-to Party
Supplier I_OperationalAcctgDocItem Supplier Supplier
DocumentItemText I_OperationalAcctgDocItem DocumentItemText Text
InvoiceReference I_OperationalAcctgDocItem InvoiceReference Invoice Reference
InvoiceReferenceFiscalYear I_OperationalAcctgDocItem InvoiceReferenceFiscalYear Invoice Reference Fiscal Year
BillingDocument I_OperationalAcctgDocItem BillingDocument SD Document
IsEUTriangularDeal I_OperationalAcctgDocItem IsEUTriangularDeal Is EU Triangular Deal
VATRegistration I_OperationalAcctgDocItem VATRegistration VAT Registration No.
TaxCountry I_OperationalAcctgDocItem TaxCountry Tax Ctry/Reg.
AmountInTransactionCurrency
AmountInCompanyCodeCurrency
_CompanyCode I_JournalEntry _CompanyCode
_Customer I_OperationalAcctgDocItem _Customer
_Supplier I_OperationalAcctgDocItem _Supplier
_OneTimeAccountBP _OneTimeAccountBP

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_PL_SAFTInvcHeaderBscVersion2.
-- 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_StartDate : datum, P_EndDate : datum

CREATE VIEW P_PL_SAFTInvcHeaderBscVersion2 AS
SELECT
  Entry.CompanyCode AS CompanyCode,
  Entry.AccountingDocument AS AccountingDocument,
  Entry.FiscalYear AS FiscalYear,
  max(Item.AccountingDocumentItem) AS AccountingDocumentItem,
  Entry.BusinessTransactionType AS BusinessTransactionType,
  Entry.TaxReportingDate AS TaxReportingDate,
  Entry.PostingDate AS PostingDate,
  Entry.DocumentDate AS DocumentDate,
  Entry.ReferenceDocumentType AS ReferenceDocumentType,
  Entry.TransactionCurrency AS TransactionCurrency,
  Entry.CompanyCodeCurrency AS CompanyCodeCurrency,
  Entry.DocumentReferenceID AS DocumentReferenceID,
  Entry.AlternativeReferenceDocument AS AlternativeReferenceDocument,
  Item.Customer AS Customer,
  Item.Supplier AS Supplier,
  Item.DocumentItemText AS DocumentItemText,
  Item.InvoiceReference AS InvoiceReference,
  Item.InvoiceReferenceFiscalYear AS InvoiceReferenceFiscalYear,
  Item.BillingDocument AS BillingDocument,
  Item.IsEUTriangularDeal AS IsEUTriangularDeal,
  Item.VATRegistration AS VATRegistration,
  Item.TaxCountry AS TaxCountry,
  sum (Item.AmountInTransactionCurrency) * -1 AS AmountInTransactionCurrency,
  sum(Item.AmountInCompanyCodeCurrency) * -1 AS AmountInCompanyCodeCurrency,
  Entry._CompanyCode AS _CompanyCode,
  Item._Customer AS _Customer,
  Item._Supplier AS _Supplier
FROM I_JournalEntry AS Entry
INNER JOIN I_OperationalAcctgDocItem AS Item ON /* join condition not captured in parsed metadata */
INNER JOIN P_PL_SAFTINVOICETAXD AS Tax ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_JournalEntryItemOneTimeData AS _OneTimeAccountBP ON CompanyCode = _OneTimeAccountBP.CompanyCode AND FiscalYear = _OneTimeAccountBP.FiscalYear AND AccountingDocument = _OneTimeAccountBP.AccountingDocument AND AccountingDocumentItem = _OneTimeAccountBP.AccountingDocumentItem  -- association [0..1]
;