P_PL_SAFTInvoiceHeaderBasic
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)
| Source | Alias | Join Type |
|---|---|---|
| I_JournalEntry | Entry | from |
| I_OperationalAcctgDocItem | Item | inner |
| P_PL_SAFTMapTaxCode | MapTaxCode | 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 (10)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| 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 | 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]
;
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