P_PL_SAFTSalesInvItem

DDL: P_PL_SAFTSALESINVITEM SQL: PPLSAFTSLSINVITM Type: view COMPOSITE

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)

SourceAliasJoin Type
P_PL_SAFTBillingDocumentBasic Header inner
I_BillingDocumentItem Item inner
P_PL_SAFTInvoiceTax Tax inner

Parameters (2)

NameTypeDefault
P_StartDate datum
P_EndDate datum

Annotations (10)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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 */
;