@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'PRSHSTAFFREQDATA'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@Consumption.dbHints: ['USE_HEX_PLAN']
/*
CONTRACT**********************************************************************************************************************
Name: Request Details
Specification: This View returns the details of Request
- it does not any aggregation regarding duration, amount etc.
- it prepares data, so aggregation can happen in calling view P_RSHStaffingRequestDetails
- this is why period & year are still part of the view key
Requires: No
Ensures: All Request specific details with the begin and end of period dates they are planned for
Owners: YS
Contributors: TR
Unit Test required Y/N: Yes
Additional comments None
END OF CONTRACT***************************************************************************************************************
*/
define view P_RSHStaffingRequestData
as select from I_EngmntProjectPlnDataVersion
left outer to one join I_EngagementProject as EngagementProject on I_EngmntProjectPlnDataVersion.EngagementProject = EngagementProject.EngagementProject
association [1..1] to I_RSHStaffingRequestVisibility as _Visibility on _Visibility.ProjectVisibilityOrigin = EngagementProject.ProjectVisibility
association [1..1] to I_WorkPackage as _WorkPackage on $projection.WorkPackage = _WorkPackage.WorkPackage
association [0..1] to I_WorkPackageWorkItem as _WorkItem on $projection.WorkItem = _WorkItem.WorkItem
and $projection.WorkPackage = _WorkItem.WorkPackage
association [0..1] to I_EngagementProjectResource as _Role on $projection.EngagementProjectResource = _Role.EngagementProjectResource
and $projection.EngagementProjectResourceType = _Role.EngagementProjectResourceType
association [0..1] to P_RSHStaffingRequestSkilltags as _Skilltags on $projection.ResourceDemandUUID = _Skilltags.ResourceDemandUUID
association [0..1] to I_PersonWorkAgreement_1 as _PreferredEmployee on _PreferredEmployee.PersonWorkAgreement = I_EngmntProjectPlnDataVersion.EmploymentInternalID
association [0..1] to I_PersonWorkAgreement_1 as _ProjectManagerEmployee on _ProjectManagerEmployee.PersonWorkAgreement = $projection.ProjectManager
association [0..1] to I_EngagementProjectSrvcOrg as _EmployeeRequestDelivOrg on _EmployeeRequestDelivOrg.EngagementProjectServiceOrg = I_EngmntProjectPlnDataVersion.EngagementProjectServiceOrg
{
key I_EngmntProjectPlnDataVersion.ResourceDemandUUID,
@Semantics.fiscal.period: true
key I_EngmntProjectPlnDataVersion.FiscalPeriod,
@Semantics.fiscal.year: true
key I_EngmntProjectPlnDataVersion.FiscalYear,
I_EngmntProjectPlnDataVersion.EngagementProject,
I_EngmntProjectPlnDataVersion.WorkPackageUUID,
I_EngmntProjectPlnDataVersion.WorkPackage,
I_EngmntProjectPlnDataVersion.WorkItem,
I_EngmntProjectPlnDataVersion.EngagementProjectResource,
I_EngmntProjectPlnDataVersion.EngagementProjectResourceType,
I_EngmntProjectPlnDataVersion.EmploymentInternalID as EmploymentInternalID,
I_EngmntProjectPlnDataVersion.UnitOfMeasure as UnitOfMeasure,
@Semantics.quantity.unitOfMeasure: 'UnitOfMeasure'
I_EngmntProjectPlnDataVersion.PlndEffortQty as EmployeeRequestDuration,
@Semantics.currencyCode: true
I_EngmntProjectPlnDataVersion.Currency as Currency,
@Semantics.amount.currencyCode: 'Currency'
cast(I_EngmntProjectPlnDataVersion.PlndRevnAmt as rsh_ps_project_planned_revenue) as PlndRevAmt,
// Deliver Org Unit of Role if specified in Role. Can be empty. => Used e.g. in Matching of Resources
I_EngmntProjectPlnDataVersion.EngagementProjectServiceOrg as EmployeeRequestDelivOrg,
// Deliver Org Unit of Role if specified in Role OR the Service Org Unit of the Project. => Used for Authorization check
coalesce( _EmployeeRequestDelivOrg.EngagementProjectServiceOrg, EngagementProject.EngagementProjectServiceOrg ) as ServiceOrganization,
// case
// when I_EngmntProjectPlnDataVersion.EngagementProjectServiceOrg is null
// or I_EngmntProjectPlnDataVersion.EngagementProjectServiceOrg = ''
// then EngagementProject.EngagementProjectServiceOrg
// else I_EngmntProjectPlnDataVersion.EngagementProjectServiceOrg
// end as ServiceOrganization,
// Project related
EngagementProject.EngagementProjectUUID,
EngagementProject.EngagementProjectStage,
EngagementProject.EngagementProjectName,
EngagementProject.Customer,
EngagementProject.EngagementProjectType,
EngagementProject.ControllingArea,
EngagementProject.CostCenter as EmployeeRequestHdrCostCenter,
EngagementProject.ProjectManager as ProjectManager,
EngagementProject.EngagementProjectServiceOrg as EmployeeRequestHdrSrvOrg,
EngagementProject.ProfitCenter as ProfitCenter,
EngagementProject.CompanyCode as CompanyCode,
EngagementProject.ProjectProfileCode as ProjectProfileCode,
cast(EngagementProject.EngagementProjectCategory as rsh_ps_staff_request_categ preserving type ) as EngagementProjectCategory,
// Demand Start Date
_WorkPackage.WorkPackageStartDate as StartDate,
// Demand End Date
_WorkPackage.WorkPackageEndDate as EndDate,
_WorkPackage.WorkPackageName,
BillingControlCategory,
// Project Visibility needs to be inverted, because CPM is inverted too. The Field from CPM should be read as "IsConfidential" and not "ProjectVisibility".
// Therefore, we need to invert the values here, to be consistent with the naming of the field (ProjectVisibility), however technically it is IsConfidential on DB.
// cast( I_EngmntProjectPlnDataVersion._EngagementProject.ProjectVisibility as rsh_ps_staff_request_publicvis) as ProjectVisibility,
cast(_Visibility.ProjectVisibility as rsh_ps_staff_request_publicvis ) as ProjectVisibility,
// Value will be populated in C_RSHSTAFFINGR01_GET_ENTITY and C_RSHSTAFFINGR01_GET_ENTITYSET
// of CL_RSH_PS_ANALYZE_DPC_EXT. The authorization is based on project header service organization
// DCL filtering would be based on service org of work package item
cast('' as rsh_project_authorization) as EmployeeRequestAuthorized,
//Last change date and time of the Project
cast(EngagementProject.LastChangeDateTime as tzntstmps) as LastChangeDateTime,
cast(EngagementProject.CreationDateTime as tzntstmps) as CreationDateTime,
concat(FiscalYear, cast(substring(FiscalPeriod,2,2 ) as calendarmonth) ) as YearMonth,
// Associations
_EngagementProjectResource,
EngagementProject._Customer,
_ProjectManagerEmployee as _ProjectManager,
_EngagementProject,
_Role,
_WorkPackage,
_WorkItem,
_PreferredEmployee,
_ProjectManagerEmployee,
_BillingControlCategory,
_Skilltags
}
where
// Only read current version, no snapshots etc.
EngagementProjectResourceType = '0ACT'
// Only Activites are relevant, Expenses etc. are not
and I_EngmntProjectPlnDataVersion.EngmtProjFinPlanVersion = '1'
//Demand Line Items (no supply)
and EngmntProjPlanLineType = 'D'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ENGAGEMENTPROJECT",
"I_ENGAGEMENTPROJECTSRVCORG",
"I_ENGMNTPROJECTPLNDATAVERSION",
"I_RSHSTAFFINGREQUESTVISIBILITY",
"I_WORKPACKAGE"
],
"ASSOCIATED":
[
"I_BILLINGCONTROLCATEGORY",
"I_CUSTOMER",
"I_ENGAGEMENTPROJECT",
"I_ENGAGEMENTPROJECTRESOURCE",
"I_ENGAGEMENTPROJECTSRVCORG",
"I_PERSONWORKAGREEMENT_1",
"I_RSHSTAFFINGREQUESTVISIBILITY",
"I_WORKPACKAGE",
"I_WORKPACKAGEWORKITEM",
"P_RSHSTAFFINGREQUESTSKILLTAGS"
],
"BASE":
[
"I_ENGAGEMENTPROJECT",
"I_ENGMNTPROJECTPLNDATAVERSION"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/