P_SPP_PredictionData01
Prediction Data 01
P_SPP_PredictionData01 is a Composite CDS View that provides data about "Prediction Data 01" in SAP S/4HANA. It reads from 2 data sources (I_BillingDocumentItemBasic, P_SPP_PredictionPeriod) and exposes 14 fields with key fields BillingDocument, BillingDocumentItem. Part of development package VDM_SD_PREDICTED_SALES.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_BillingDocumentItemBasic | I_BillingDocumentItemBasic | from |
| P_SPP_PredictionPeriod | PP | left_outer |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PSDSPPPDA01 | view | |
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (14)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | BillingDocument | BillingDocument | ||
| KEY | BillingDocumentItem | BillingDocumentItem | ||
| BillingDocumentDate | BillingDocumentDate | |||
| SalesOrganization | SalesOrganization | |||
| DistributionChannel | DistributionChannel | |||
| Division | Division | |||
| SoldToParty | SoldToParty | |||
| CustomerGroup | CustomerGroup | |||
| Material | Material | |||
| MaterialGroup | MaterialGroup | |||
| BillingDocumentType | BillingDocumentType | |||
| DisplayCurrency | ||||
| TransactionCurrency | TransactionCurrency | |||
| NetAmount | NetAmount |
@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_BillingDocumentItemBasic
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
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- 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