P_ARCalendarLast12Mnths
Gives Last Year Date From Key Date
P_ARCalendarLast12Mnths is a Composite CDS View that provides data about "Gives Last Year Date From Key Date" in SAP S/4HANA. It reads from 2 data sources (I_CalendarDate, I_CalendarDate) and exposes 2 fields. Part of development package ODATA_AR_OVP.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_CalendarDate | Last12Months | inner |
| I_CalendarDate | ThisMonth | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_KeyDate | sydate |
Annotations (5)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PARPROM2PAYCAL | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view |
Fields (2)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KeyDate | ||||
| FirstDayOfLastYearDate | I_CalendarDate | FirstDayOfMonthDate |
@AbapCatalog.sqlViewName: 'PARPROM2PAYCAL'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@VDM.private:true
define view P_ARCalendarLast12Mnths
with parameters
P_KeyDate : sydate
as select from I_CalendarDate as ThisMonth
inner join I_CalendarDate as Last12Months on Last12Months.CalendarDate = DATS_ADD_MONTHS(
$parameters.P_KeyDate, - 12, 'FAIL'
)
{
$parameters.P_KeyDate as KeyDate,
Last12Months.FirstDayOfMonthDate as FirstDayOfLastYearDate
}
where
ThisMonth.CalendarDate = $parameters.P_KeyDate
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