@AbapCatalog.sqlViewName : 'PRSHRESCAPKPIS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@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 Capacity KPIs
Specification: Gives resource utilization info on a monthly basis between the given dates
Requires: Period for which the monthly capacity information is sought
Ensures: Monthly utilization percentage is returned for Resources for the specified period
Owners: PSP
Contributors: PSP
Unit Test required Y/N: N
Additional comments None
END OF CONTRACT**************************************************************************************************************/
define view P_RSHResourceCapacityKPIs
with parameters
P_StartDate : syst_datum,
P_EndDate : syst_datum
as select from P_RSHResourceMonthlyUtilizatn( P_StartDate: $parameters .P_StartDate, P_EndDate:$parameters .P_EndDate)
inner join P_RSHResource( P_StartDate: $parameters .P_StartDate, P_EndDate:$parameters .P_EndDate) on P_RSHResource.EmploymentInternalId = P_RSHResourceMonthlyUtilizatn.EmploymentInternalId
{
key P_RSHResourceMonthlyUtilizatn.EmploymentInternalId,
key P_RSHResourceMonthlyUtilizatn.YearMonth,
P_RSHResource.CostCenter,
P_RSHResourceMonthlyUtilizatn.EmployeeStaffedHours,
P_RSHResourceMonthlyUtilizatn.EmployeeAvailableHours,
// Of course, Utilization = Staffed Hours / Available Hours!
case
when P_RSHResourceMonthlyUtilizatn.EmployeeAvailableHours is not null and P_RSHResourceMonthlyUtilizatn.EmployeeAvailableHours > 0.00
//standard use-case : resource has available hours->simply divide for utilization
then division( P_RSHResourceMonthlyUtilizatn.EmployeeStaffedHours, P_RSHResourceMonthlyUtilizatn.EmployeeAvailableHours, 2) * 100
else
//Resource either has no availability assigned or 0 available hours
case
when P_RSHResourceMonthlyUtilizatn.EmployeeStaffedHours is null or P_RSHResourceMonthlyUtilizatn.EmployeeStaffedHours = 0
//no availability, no staffing->0 utilization
then cast (0 as abap.int2 )
else
//no availability but staffings->return exception utilization rate
cast (999 as abap.int2 )
end
end as MonthlyUtilPercentage,
P_RSHResource.CompanyCode,
substring(P_RSHResourceMonthlyUtilizatn.YearMonth, 5, 2) as CalendarMonth
}
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"P_RSHRESOURCE",
"P_RSHRESOURCEMONTHLYUTILIZATN"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_RSHResourceCapacityKPIs view