@AbapCatalog.sqlViewName : 'PSDSPPPDA01'
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view P_SPP_PredictionData01
as select from I_BillingDocExtdItemBasic
left outer join P_SPP_PredictionPeriod as PP
on PP.CalendarDate = PP.CalendarDate
{
key BillingDocument,
key BillingDocumentItem,
BillingDocumentDate,
SalesOrganization,
DistributionChannel,
Division,
SoldToParty,
CustomerGroup,
Material,
MaterialGroup,
BillingDocumentType,
cast ( 'EUR' as vdm_v_display_currency) as DisplayCurrency,
TransactionCurrency,
NetAmount,
case
when ( SDDocumentCategory = 'M'
or SDDocumentCategory = 'P'
or SDDocumentCategory = 'S'
or SDDocumentCategory = '5'
)
then
cast ( ABS( NetAmount) as netwr )
when ( SDDocumentCategory = 'O'
or SDDocumentCategory = 'N'
or SDDocumentCategory = '6'
)
then
cast ( -1 * ABS( NetAmount) as netwr )
end
as Amount
}
where StatisticalValueControl = ''
and BillingDocumentCategory != 'P'
and BillingDocumentIsTemporary = ''
and OverallBillingStatus <> 'C'
and ( SDDocumentCategory = 'M' // Invoice
or SDDocumentCategory = 'N' // Invoice Canceled
or SDDocumentCategory = 'O' // Credit Memo
or SDDocumentCategory = 'P' // Debit Memo
or SDDocumentCategory = 'S' // Credit Memo Canceled
or SDDocumentCategory = 'U' // Pro Forma Invoice
or SDDocumentCategory = '5' // Intercompany Invoice
or SDDocumentCategory = '6' // Intercompany Credit Memo
)
and BillingDocumentDate >= PP.PredictionStartDate1
and BillingDocumentDate < PP.PredictionEndDate
and NetAmount != 0
and NetAmount is not null
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_BILLINGDOCEXTDITEMBASIC",
"P_SPP_PREDICTIONPERIOD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_SPP_PredictionData01 view