P_PL_SAFTInvcHeaderBscVersion2
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)
| Source | Alias | Join Type |
|---|---|---|
| I_JournalEntry | Entry | from |
| I_OperationalAcctgDocItem | Item | inner |
| P_PL_SAFTINVOICETAXD | Tax | inner |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_StartDate | datum | |
| P_EndDate | datum |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA