P_PL_SAFTSALESINVITEM
P_PL_SAFTSALESINVITEM is a CDS View in S/4HANA. 1 CDS views read from this table.
CDS Views using this table (1)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| P_PL_SAFTInvoiceItem | view | from | CONSUMPTION |
@AbapCatalog.sqlViewName: 'PPLSAFTSLSINVITM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_PL_SAFTSalesInvItem
with parameters
P_StartDate : datum,
P_EndDate : datum
as select distinct from P_PL_SAFTInvoiceHeaderBasic( P_StartDate:$parameters.P_StartDate, P_EndDate: $parameters.P_EndDate) as Entry
inner join I_BillingDocumentItem as Item on Item.BillingDocument = Entry.BillingDocument
inner join P_PL_SAFTBillingDocumentBasic as Header on Header.BillingDocument = Item.BillingDocument
and(
Header.PL_SAFTInvoiceType <> 'ZAL'
or Header.CancelledBillingDocument is not initial
)
inner join P_PL_SAFTInvoiceTax as Tax on Tax.CompanyCode = Entry.CompanyCode
and Tax.AccountingDocument = Entry.AccountingDocument
and Tax.FiscalYear = Entry.FiscalYear
and Tax.TaxCode = Item.TaxCode
{
key Entry.CompanyCode,
key Entry.AccountingDocument,
key Entry.FiscalYear,
key Item.BillingDocument,
key Item.BillingDocumentItem,
Header.PL_SAFTInvoiceType,
Header.CancelledBillingDocument,
case when Header.SDDocumentCategory = 'O' //Credit Memo
or Header.SDDocumentCategory = 'N' //Invoice Cancellation
or Header.SDDocumentCategory = '4' //Credit Memo List
then 'X'
else ' '
end as ItemSignIsReversed,
Item.BillingDocumentItemText,
Item.BillingQuantityUnit,
Item.BillingQuantity,
@Semantics.amount.currencyCode: 'TransactionCurrency'
cast( case when Item.BillingQuantity is not initial
then division(Item.NetAmount,Item.BillingQuantity,2)
else Item._SalesDocumentItem.NetPriceAmount
end as netpr) as NetPriceAmount,
@Semantics.currencyCode: true
Entry.CompanyCodeCurrency,
@Semantics.currencyCode: true
Item.TransactionCurrency,
@Semantics.amount.currencyCode: 'TransactionCurrency'
Item.NetAmount,
@Semantics.amount.currencyCode: 'TransactionCurrency'
case
when Header.BillingDocumentType = 'G2DP' and Header.PL_SAFTInvoiceType = 'KOREKTA'
then 0
else Item.Subtotal1Amount - Item.NetAmount
end as DiscountAmount,
Item._PricingElement[ ConditionApplication = 'V'
and ConditionClass = 'D'
and ConditionCategory = 'D'
and ConditionInactiveReason = ''
and ConditionIsForStatistics = ''
].TaxCode,
Tax.PL_SAFTTaxPercentageCode
}
where
Entry.BusinessTransactionType = 'SD00'
and not(
Header.PL_SAFTInvoiceType = 'ZAL'
and Header.CancelledBillingDocument is not initial
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENTITEM",
"I_BILLINGDOCUMENTITEMPRCGELMNT",
"I_SALESDOCUMENTITEM",
"P_PL_SAFTBILLINGDOCUMENTBASIC",
"P_PL_SAFTINVOICEHEADERBASIC",
"P_PL_SAFTINVOICETAX"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/