P_RSHEndDate

DDL: P_RSHENDDATE SQL: PRSHENDDATE Type: view CONSUMPTION Package: RSH_CDS_ORD

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)

SourceAliasJoin Type
I_CalendarDate I_CalendarDate from

Parameters (1)

NameTypeDefault
P_current_date datum

Annotations (9)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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