P_RSHResourceWeeklyUtilization is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_CalendarDate, P_RSHResourceUtilization) and exposes 6 fields with key fields EmploymentInternalID, YearWeek.
@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**************************************************************************************************************/defineview P_RSHResourceWeeklyUtilization
withparameters
P_StartDate : syst_datum,
P_EndDate : syst_datum,
P_WeekStart : abap.int1asselectfrom P_RSHResourceUtilization as _ResourceUtilization
innerjoin 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
groupby
EmploymentInternalId,
YearWeek
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE",
"P_RSHRESOURCEUTILIZATION"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/