P_RSHResourceWeeklyUtilization

DDL: P_RSHRESOURCEWEEKLYUTILIZATION SQL: PRSHRESWEEKLYUTL Type: view COMPOSITE Package: RSH_CDS_RES

Resource Weekly Utilization Information

P_RSHResourceWeeklyUtilization is a Composite CDS View that provides data about "Resource Weekly Utilization Information" in SAP S/4HANA. It reads from 2 data sources (I_CalendarDate, P_RSHResourceUtilization) and exposes 6 fields with key fields EmploymentInternalID, YearWeek. Part of development package RSH_CDS_RES.

Data Sources (2)

SourceAliasJoin Type
I_CalendarDate _CalendarDate inner
P_RSHResourceUtilization _ResourceUtilization from

Parameters (3)

NameTypeDefault
P_StartDate syst_datum
P_EndDate syst_datum
P_WeekStart abap.int1

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PRSHRESWEEKLYUTL view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_ALLOWED view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #XL view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY EmploymentInternalID EmploymentInternalId
KEY YearWeek YearWeek
StartDate
EndDate
EmployeeAvailabilityInHours
EmployeeStaffedHours
@AbapCatalog.sqlViewName: 'PRSHRESWEEKLYUTL'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_ALLOWED
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.sizeCategory: #XL
@ClientHandling.algorithm: #SESSION_VARIABLE

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

Name:                       Resource Weekly Utilization Info
Specification:              Gives weekwise utilization information for resources between the given dates
Requires:                   Period for which the monthly capacity information is sought
Ensures:                    Total Staffed and Total Availability information for resources is returned
Owners:                     RY
Contributors:               RY
Unit Test required Y/N:     Yes - uses summation
Additional comments         None

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

define view P_RSHResourceWeeklyUtilization
  with parameters
    P_StartDate : syst_datum,
    P_EndDate   : syst_datum,
    P_WeekStart : abap.int1
  as select from P_RSHResourceUtilization as _ResourceUtilization
    inner join   I_CalendarDate           as _CalendarDate on _CalendarDate.CalendarDate = dats_add_days(
      _ResourceUtilization.CalendarDate, $parameters.P_WeekStart, 'INITIAL'
    )

{
  key EmploymentInternalId                   as EmploymentInternalID,
  key YearWeek,

      min(_ResourceUtilization.CalendarDate) as StartDate,
      max(_ResourceUtilization.CalendarDate) as EndDate,
      sum(EmployeeAvailableHours )           as EmployeeAvailabilityInHours,
      sum(EmployeeStaffedHours )             as EmployeeStaffedHours

}
where
  _ResourceUtilization.CalendarDate between $parameters.P_StartDate and $parameters.P_EndDate

group by
  EmploymentInternalId,
  YearWeek