P_RSHEndDate
Gives the max end date allowed
P_RSHEndDate is a Consumption CDS View that provides data about "Gives the max end date allowed" in SAP S/4HANA. It reads from 1 data source (I_CalendarDate) and exposes 4 fields with key field WorkStartDate. Part of development package RSH_CDS_ORD.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_CalendarDate | I_CalendarDate | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_current_date | datum |
Annotations (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PRSHENDDATE | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #CONSUMPTION | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.dataClass | #CUSTOMIZING | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #S | view |
Fields (4)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | WorkStartDate | |||
| CurrentDate | ||||
| NextWeekEndDate | ||||
| WorkEndDate |
@AbapCatalog.sqlViewName: 'PRSHENDDATE'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #CUSTOMIZING
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #S
/*
CONTRACT**********************************************************************************************************************
Name:
Specification: This view returns the time window defining the last 6 months and next 4 weeks with respect to the supplied date.
Requires: Start Date
-The supplied date will be the starting day of this timeframe
Ensures: Returns start date of past 6 months and end date of the 4th Week
Owners: PRP
Contributors: AN, PK
Unit Test required Y/N: Yes
Additional comments None
END OF CONTRACT***************************************************************************************************************
*/
define view P_RSHEndDate
with parameters
P_current_date : datum
as select from I_CalendarDate
{
key dats_add_months($parameters.P_current_date, -6, 'NULL') as WorkStartDate,
$parameters.P_current_date as CurrentDate,
dats_add_days($parameters.P_current_date, 14 - cast(I_CalendarDate.WeekDay as integer), 'NULL') as NextWeekEndDate,
dats_add_days($parameters.P_current_date, 28 - cast(I_CalendarDate.WeekDay as integer), 'NULL') as WorkEndDate
}
where
I_CalendarDate.CalendarDate = $parameters.P_current_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