P_PL_SAFTInvoiceHeaderBasic

DDL: P_PL_SAFTINVOICEHEADERBASIC SQL: PPLSAFTINVHDRBSC Type: view COMPOSITE

P_PL_SAFTInvoiceHeaderBasic is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_JournalEntry, I_OperationalAcctgDocItem, P_PL_SAFTMapTaxCode) 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_SAFTMapTaxCode MapTaxCode 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 (10)

NameValueLevelField
AbapCatalog.sqlViewName PPLSAFTINVHDRBSC view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #P view
ClientHandling.algorithm #SESSION_VARIABLE 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 Customer Sold-to Party
Supplier Supplier Supplier
DocumentItemText DocumentItemText Text
InvoiceReference InvoiceReference Invoice Reference
InvoiceReferenceFiscalYear InvoiceReferenceFiscalYear Invoice Reference Fiscal Year
BillingDocument BillingDocument SD Document
IsEUTriangularDeal IsEUTriangularDeal Is EU Triangular Deal
VATRegistration I_OperationalAcctgDocItem VATRegistration VAT Registration No.
TaxCountry I_OperationalAcctgDocItem TaxCountry Tax Ctry/Reg.
AmountInTransactionCurrency
AmountInCompanyCodeCurrency
_CompanyCode _CompanyCode
_Customer _Customer
_Supplier _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_SAFTInvoiceHeaderBasic.
-- 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: PPLSAFTINVHDRBSC
-- Parameters: P_StartDate : datum, P_EndDate : datum

CREATE VIEW P_PL_SAFTInvoiceHeaderBasic AS
SELECT
  Entry.CompanyCode AS CompanyCode,
  Entry.AccountingDocument AS AccountingDocument,
  Entry.FiscalYear AS FiscalYear,
  max(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,
  Customer,
  Supplier,
  DocumentItemText,
  InvoiceReference,
  InvoiceReferenceFiscalYear,
  BillingDocument,
  IsEUTriangularDeal,
  Item.VATRegistration AS VATRegistration,
  Item.TaxCountry AS TaxCountry,
  sum(MapTaxCode.AmountInTransactionCurrency) AS AmountInTransactionCurrency,
  sum(MapTaxCode.AmountInCompanyCodeCurrency) AS AmountInCompanyCodeCurrency
FROM I_JournalEntry AS Entry
INNER JOIN I_OperationalAcctgDocItem AS Item ON /* join condition not captured in parsed metadata */
INNER JOIN P_PL_SAFTMapTaxCode AS MapTaxCode 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]
;