P_SPP_PredictionPeriod
Prediction Period
P_SPP_PredictionPeriod is a Composite CDS View that provides data about "Prediction Period" in SAP S/4HANA. It reads from 1 data source (I_CalendarDate) and exposes 7 fields with key field CalendarDate. Part of development package VDM_SD_PREDICTED_SALES.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_CalendarDate | I_CalendarDate | from |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PSDSPPPP | view | |
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (7)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CalendarDate | CalendarDate | ||
| PredictionStartDate1 | ||||
| PredictionStartDate2 | ||||
| PredictionStartDate3 | ||||
| PredictionEndDate | ||||
| CurrentYearMonth | YearMonth | |||
| NextYearMonth |
@AbapCatalog.sqlViewName: 'PSDSPPPP'
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view P_SPP_PredictionPeriod
as select from I_CalendarDate
{
key CalendarDate,
// Prediction dimension selection:
// PredictionStartDate2 -> PredictionEndDate
// Prediction period selection
// PredictionStartDate3 -> PredictionEndDate
// Data used for prediction
// PredictionStartDate1 -> PredictionEndDate
concat( left( dats_add_months( CalendarDate, -6, 'FAIL'), 6 ), '01') as PredictionStartDate1,
concat( left( dats_add_months( CalendarDate, -3, 'FAIL'), 6 ), '01') as PredictionStartDate2,
concat( YearMonth, '01') as PredictionStartDate3,
concat( left( dats_add_months( CalendarDate, 2, 'FAIL'), 6 ), '01') as PredictionEndDate,
cast(
case
when CalendarDay >= '01' and CalendarDay <= '10'
then 1
when CalendarDay >= '11' and CalendarDay <= '20'
then 2
else 2
end
as sp_pom ) as CurrentPartOfMonth,
YearMonth as CurrentYearMonth,
left( dats_add_months( CalendarDate, 1, 'FAIL'), 6 ) as NextYearMonth
}
where CalendarDate = $session.system_date
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