P_Referencedates
P_Referencedates is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_CalendarDate) and exposes 3 fields.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_CalendarDate | I_CalendarDate | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_DateFunctionValidityDate | sydats |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PDFREFDATES | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| ObjectModel.usageType.serviceQuality | #P | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (3)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| CalendarDate | CalendarDate | |||
| LastYearDate | ||||
| NextYearDate |
@AbapCatalog.sqlViewName: 'PDFREFDATES'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #CONSUMPTION
@VDM.private: true
//@EndUserText.label: 'Calculate Last and Next Year for a date'
@ObjectModel.usageType.serviceQuality: #P
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_Referencedates with parameters
P_DateFunctionValidityDate: sydats
as select from I_CalendarDate
{
CalendarDate,
dats_add_months( CalendarDate, -12, 'FAIL') as LastYearDate,
dats_add_months( CalendarDate, 12, 'FAIL') as NextYearDate
}
where
CalendarDate = $parameters.P_DateFunctionValidityDate
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"VERSION":0
}
}*/
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