P_PL_SAFTSalesInvItem
P_PL_SAFTSalesInvItem is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (P_PL_SAFTBillingDocumentBasic, I_BillingDocumentItem, P_PL_SAFTInvoiceTax) and exposes 18 fields with key fields CompanyCode, AccountingDocument, FiscalYear, BillingDocument, BillingDocumentItem.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| P_PL_SAFTBillingDocumentBasic | Header | inner |
| I_BillingDocumentItem | Item | inner |
| P_PL_SAFTInvoiceTax | Tax | inner |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_StartDate | datum | |
| P_EndDate | datum |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PPLSAFTSLSINVITM | 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 | #D | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (18)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | Entry | CompanyCode | Receiver Company Code |
| KEY | AccountingDocument | Entry | AccountingDocument | Journal Entry |
| KEY | FiscalYear | Entry | FiscalYear | G/L Fiscal Year |
| KEY | BillingDocument | I_BillingDocumentItem | BillingDocument | SD Document |
| KEY | BillingDocumentItem | I_BillingDocumentItem | BillingDocumentItem | Item |
| PL_SAFTInvoiceType | P_PL_SAFTBillingDocumentBasic | PL_SAFTInvoiceType | ||
| CancelledBillingDocument | P_PL_SAFTBillingDocumentBasic | CancelledBillingDocument | Canceld Bill.Dc | |
| BillingDocumentItemText | I_BillingDocumentItem | BillingDocumentItemText | Item Descr. | |
| BillingQuantityUnit | I_BillingDocumentItem | BillingQuantityUnit | Sales Unit | |
| BillingQuantity | I_BillingDocumentItem | BillingQuantity | Invoiced Qty | |
| NetPriceAmountendasnetprasNetPriceAmount | ||||
| CompanyCodeCurrency | Entry | CompanyCodeCurrency | Local Currency | |
| TransactionCurrency | I_BillingDocumentItem | TransactionCurrency | Transaction Currency | |
| NetAmount | I_BillingDocumentItem | NetAmount | Stated Amount | |
| GrossAmount | ||||
| NetAmountendasDiscountAmount | ||||
| TaxCode | ||||
| PL_SAFTTaxPercentageCode | P_PL_SAFTInvoiceTax | PL_SAFTTaxPercentageCode |
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_SAFTSalesInvItem.
-- 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: PPLSAFTSLSINVITM
-- Parameters: P_StartDate : datum, P_EndDate : datum
CREATE VIEW P_PL_SAFTSalesInvItem AS
SELECT
Entry.CompanyCode AS CompanyCode,
Entry.AccountingDocument AS AccountingDocument,
Entry.FiscalYear AS FiscalYear,
Item.BillingDocument AS BillingDocument,
Item.BillingDocumentItem AS BillingDocumentItem,
Header.PL_SAFTInvoiceType AS PL_SAFTInvoiceType,
Header.CancelledBillingDocument AS CancelledBillingDocument,
Item.BillingDocumentItemText AS BillingDocumentItemText,
Item.BillingQuantityUnit AS BillingQuantityUnit,
Item.BillingQuantity AS BillingQuantity,
cast( case when Item.BillingQuantity is not initial then division(Item.NetAmount,Item.BillingQuantity,2) else Item._SalesDocumentItem.NetPriceAmount end as netpr) as NetPriceAmount AS NetPriceAmountendasnetprasNetPriceAmount,
Entry.CompanyCodeCurrency AS CompanyCodeCurrency,
Item.TransactionCurrency AS TransactionCurrency,
Item.NetAmount AS NetAmount,
Item.NetAmount + Item.TaxAmount AS GrossAmount,
case when Header.BillingDocumentType = 'G2DP' and Header.PL_SAFTInvoiceType = 'KOREKTA' then 0 else Item.Subtotal1Amount - Item.NetAmount end as DiscountAmount AS NetAmountendasDiscountAmount,
Item._PricingElement[ (ConditionApplication = 'V' or ConditionApplication = 'TX') and ConditionClass = 'D' and ConditionCategory = 'D' and ConditionInactiveReason = '' and ConditionIsForStatistics = '' ].TaxCode AS TaxCode,
Tax.PL_SAFTTaxPercentageCode AS PL_SAFTTaxPercentageCode
INNER JOIN I_BillingDocumentItem AS Item ON /* join condition not captured in parsed metadata */
INNER JOIN P_PL_SAFTBillingDocumentBasic AS Header ON /* join condition not captured in parsed metadata */
INNER JOIN P_PL_SAFTInvoiceTax AS Tax ON /* join condition not captured in parsed metadata */
;
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