P_PrevMonthForCurrentMonth
Previous Month Details for Current Month
P_PrevMonthForCurrentMonth is a Consumption CDS View that provides data about "Previous Month Details for Current Month" in SAP S/4HANA. It reads from 2 data sources (I_CalendarDate, I_CalendarDate) and exposes 2 fields with key field YearMonth. Part of development package APPL_MM_PUR_DLVPRED_ML.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_CalendarDate | CurrMonth | from |
| I_CalendarDate | LastMonth | left_outer |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PPREVMONTH | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| EndUserText.label | Previous Month Details for Current Month | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (2)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | YearMonth | I_CalendarDate | YearMonth | |
| PreviousMonthNumber |
@AbapCatalog.sqlViewName: 'PPREVMONTH'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@EndUserText.label: 'Previous Month Details for Current Month'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_PrevMonthForCurrentMonth
as select from I_CalendarDate as CurrMonth
left outer join I_CalendarDate as LastMonth on CurrMonth.YearMonth > LastMonth.YearMonth
{
key CurrMonth.YearMonth as YearMonth,
max(LastMonth.YearMonth) as PreviousMonthNumber
}
group by
CurrMonth.YearMonth
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