P_RSHRESOURCETIMESLICE

CDS View

P_RSHRESOURCETIMESLICE is a CDS View in S/4HANA. It contains 6 fields. 5 CDS views read from this table.

CDS Views using this table (5)

ViewTypeJoinVDMDescription
C_RSHGanttNonWorkingTime view from CONSUMPTION Non working time for Resources
C_RSHResourceTimeSlice view from CONSUMPTION RSH Resource Time Slice
C_RSHStaffingRequestForRes view left_outer CONSUMPTION Staffing Request for Resource
C_RSHTableBasedTreeProperties view from CONSUMPTION View for additional tree properties
P_RSHAvailMatchMonthlyCalc view left_outer COMPOSITE

Fields (6)

KeyField CDS FieldsUsed in Views
KEY EmploymentInternalID EmployeeParentRowId,EmploymentInternalID 2
KEY StartDate StartDate 1
AuthorizationGroup AuthorizationGroup 1
CompanyCode CompanyCode 1
CostCenter CostCenter 1
IsBusinessPurposeCompleted IsBusinessPurposeCompleted 1
@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:                    All key and 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***************************************************************************************************************
*/

define view P_RSHResourceTimeSlice

  as select from I_PersonWorkAgrmtOrglDetails as ResourceTimeSlice
    inner join   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.from
  key  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":""
}
}*/