@AbapCatalog.sqlViewName: 'PRSHRESOURCESLC'
@AbapCatalog.compiler.compareFilter: true@AccessControl.authorizationCheck: #NOT_REQUIRED@ObjectModel.usageType.dataClass: #MIXED@ObjectModel.usageType.serviceQuality: #D@ObjectModel.usageType.sizeCategory: #XL@VDM.private: true@VDM.viewType: #COMPOSITE@ClientHandling.algorithm: #SESSION_VARIABLE/*
CONTRACT**********************************************************************************************************************
Name: THE Central RSH View for Resource Time Slices
Specification: This view returns all relevant key data of resources for time slices according the organizational resource data
Requires: n/a
Ensures: Allkeyand base resource data is returned.
Owners: JS
Contributors: JS
Unit Test required Y/N: Yes
Additional comments - Can be used as substitute for P_RSHResource when Parameter cannot be used
- E.g. via according condition for assignment start/end date and resource start/end date
END OF CONTRACT***************************************************************************************************************
*/defineview P_RSHResourceTimeSlice
asselectfrom I_PersonWorkAgrmtOrglDetails as ResourceTimeSlice
innerjoin I_PersonWorkAgreement_1 as Resource on Resource.PersonWorkAgreement = ResourceTimeSlice.PersonWorkAgreement
//We can only read ServiceCostLevel for Start or EndDate of ResourceTimeslice as KeyDate to ensure that only 1 ServiceCostLevel entry is returned
association [0..1] to I_PersonWorkAgrmtSrvcCostLevel as _ServiceCostLevel on _ServiceCostLevel.PersonWorkAgreement = $projection.EmploymentInternalID
and _ServiceCostLevel.StartDate <= ResourceTimeSlice.StartDate
and _ServiceCostLevel.EndDate >= ResourceTimeSlice.StartDate
association [0..1] to I_RSHResourceServiceOrg as _ServiceOrg on $projection.CostCenter = _ServiceOrg.AssignedOrganisation and $projection.CompanyCode = _ServiceOrg.CompanyCode
association [0..1] to I_WorkforcePersonImageURL as _WorkforcePersonImageUrl on _WorkforcePersonImageUrl.Person = Resource.Person
association [0..1] to I_Address as _address on _address.AddressID = $projection.addressid
{
//ResourceTimeSlice
key ResourceTimeSlice.PersonWorkAgreement as EmploymentInternalID,
@Semantics.businessDate.fromkey ResourceTimeSlice.StartDate,
ResourceTimeSlice.EndDate,
ResourceTimeSlice.CompanyCode,
ResourceTimeSlice.CostCenter,
ResourceTimeSlice.Job,
ResourceTimeSlice.OrganizationalUnit,
ResourceTimeSlice.PersonWorkAgrmtAuthznGrpg,
Resource.Person,
Resource._WorkforcePerson.PersonExternalID,
Resource._WorkforcePerson.FirstName,
Resource._WorkforcePerson.LastName,
Resource._WorkforcePerson.MiddleName,
Resource._WorkforcePerson.AdditionalLastName,
Resource._WorkforcePerson.PersonFullName,
Resource._WorkforcePerson.BusinessPartnerUUID,
Resource._WorkforcePerson.AuthorizationGroup,
Resource._WorkforcePerson.IsBusinessPurposeCompleted,
/* Associations *///ResourceTimeSlice
ResourceTimeSlice._CompanyCode,
ResourceTimeSlice._CostCenter,
ResourceTimeSlice._OrganizationalUnitText,
ResourceTimeSlice._PersonWorkAgrmtJobText,
//Resource-WorkforcePerson
Resource._WorkforcePerson._WorkplaceAddress,
_WorkforcePersonImageUrl,
//Own Associations
_ServiceOrg,
// _ServiceOrg.ControllingArea,
_ServiceCostLevel,
_ServiceCostLevel.ServiceCostLevel,
Resource._WorkforcePerson._WorkplaceAddress.AddressID,
_address
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PERSONWORKAGREEMENT_1",
"I_PERSONWORKAGRMTORGLDETAILS",
"I_PERSONWORKAGRMTSRVCCOSTLEVEL",
"I_WORKFORCEPERSON",
"I_WORKPLACEADDRESS"
],
"ASSOCIATED":
[
"I_ADDRESS",
"I_COMPANYCODE",
"I_COSTCENTER",
"I_ORGANIZATIONALUNITTEXT",
"I_PERSONWORKAGRMTJOBTEXT",
"I_PERSONWORKAGRMTSRVCCOSTLEVEL",
"I_RSHRESOURCESERVICEORG",
"I_WORKFORCEPERSONIMAGEURL",
"I_WORKPLACEADDRESS"
],
"BASE":
[
"I_PERSONWORKAGRMTORGLDETAILS",
"I_WORKFORCEPERSON"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/