P_RSHThisWeekAndNextWeek

DDL: P_RSHTHISWEEKANDNEXTWEEK SQL: PRSHTHISCWNEXTCW Type: view CONSUMPTION

P_RSHThisWeekAndNextWeek is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_CalendarDate) and exposes 5 fields with key field DateOfCurrentWeek.

Data Sources (1)

SourceAliasJoin Type
I_CalendarDate I_CalendarDate from

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PRSHTHISCWNEXTCW view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY DateOfCurrentWeek CalendarDate
DateOfNextWeek
DateOfPreviousWeek
DateofThirdWeek
DateofFourthWeek
@AbapCatalog.sqlViewName: 'PRSHTHISCWNEXTCW'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE

/*
CONTRACT**********************************************************************************************************************

Name:                       Date of current week and next week
Specification:              This view helps to convert rows into columns in work center utilization service.
                            It is not possible to return two calendar weeks with one CDS View.
Requires:                   NA
Ensures:                    Date of current week and next week is returned
Owners:                     AN
Contributors:               PRP
Unit Test required Y/N:     Yes
Additional comments         None

END OF CONTRACT***************************************************************************************************************
*/

define view P_RSHThisWeekAndNextWeek
  as select from I_CalendarDate
{

  key CalendarDate                            as DateOfCurrentWeek,

      dats_add_days(CalendarDate, 7, 'FAIL')  as DateOfNextWeek,
      dats_add_days(CalendarDate, -7, 'FAIL') as DateOfPreviousWeek,
      dats_add_days(CalendarDate, 14, 'FAIL') as DateofThirdWeek,
      dats_add_days(CalendarDate, 21, 'FAIL') as DateofFourthWeek
}

where
  CalendarDate = $session.system_date