R_WORKASSIGNMENTTP
Work assignment TP
R_WORKASSIGNMENTTP is a CDS View in S/4HANA. Work assignment TP. 2 CDS views read from this table.
CDS Views using this table (2)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| C_WorkAssignment | view_entity | projection | CONSUMPTION | Projection of work assignment |
| R_WorkAssgmtPaymentTP | view_entity | inner | TRANSACTIONAL | TP View for Payment for Workforce Person |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Work assignment TP'
@Metadata.ignorePropagatedAnnotations: true
@VDM: {
viewType: #TRANSACTIONAL,
lifecycle.contract.type: #SAP_INTERNAL_API
}
//@AccessControl.privilegedAssociations: [ '_BPDataControllerUsage' ]
@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #XL,
dataClass: #MASTER
}
define view entity R_WorkAssignmentTP
as select distinct from R_WorkAssignmentKeyMap as _AssignmentKeyMap
//Get the Employment BP (for both old and new BP Models)
inner join R_WorkAssignmentBP as _BuPaIdentification on _BuPaIdentification.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment
inner join R_BPUsrRole as _BPUsrRole on _BPUsrRole.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
and _BPUsrRole.BPRoleCategoryUsageCode = _BuPaIdentification.BPRoleCategoryUsageCode
left outer to one join R_WorkAssignmentKeyMapOldModel on R_WorkAssignmentKeyMapOldModel.BusinessPartner = _AssignmentKeyMap.BusinessPartner
and _AssignmentKeyMap.WorkforceBPModelType = 'O'
association [0..1] to R_BPUsrRoleText as _BPUsrRoleText on _BPUsrRoleText.Role = $projection.BasicRoleCategory
and _BPUsrRoleText.Language = $session.system_language
association [1..1] to I_BusinessPartner as _WorkforcePersonBP on _WorkforcePersonBP.BusinessPartner = _AssignmentKeyMap.BusinessPartner
association [1..1] to I_BusinessPartner as _WorkAssignmentBP on _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
association [1..1] to I_WorkAssignmentDetail_1 as _AssignmentDetailsForKeyDate on _AssignmentDetailsForKeyDate.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment
and _AssignmentDetailsForKeyDate.WorkforceAssgmtStartDate = _BPUsrRole.BPUsrRoleValidFromDate
association [0..1] to I_CompanyCode as _CompanyCodeText on _CompanyCodeText.CompanyCode = $projection.CompanyCode
composition [1..*] of R_WorkAssignmentDetailsTP as _WorkAssignmentDetails
composition [0..*] of R_WorkAssgmtSrvcCostLvlTP as _WorkAssgmtSrvcCostLvl
composition [0..*] of R_BPRltnShipSupplierTP as _BPRltnShipSupplier
composition [0..*] of R_WorkAssgmtAltCostAssgmtTP as _WorkAssgmtAltCostAssgmt
// composition [0..*] of R_WorkAssgmtPaymentTP as _WorkAssignmentPayment
// composition [0..*] of R_WorkAssgmtPrivateAddressTP as _WorkAssgmtPrivateAddress
association to parent R_WorkforcePersonTP as _WorkforcePerson on $projection.PersonUUID = _WorkforcePerson.PersonUUID
// association [0..*] to I_BPDataControllerUsage as _BPDataControllerUsage on $projection.Person = _BPDataControllerUsage.BusinessPartner
{
key _WorkAssignmentBP.BusinessPartnerUUID as WorkAssignmentUUID,
_BPUsrRole.BPUsrRoleValidFromDate as StartDate,
_BPUsrRole.BPUsrRoleValidToDate as EndDate,
_AssignmentKeyMap.WorkforceAssignment as WorkAssignment, //PERNR
_AssignmentKeyMap.WorkAssignmentExternalID as WorkAssignmentExternalID,
//Replacing WorkAssignmentExternalID with User ID field in the UI because these fields could differ if in case of replication
_AssignmentKeyMap.WorkforcePersonID as WorkforcePersonID,
_AssignmentKeyMap.WorkforcePersonUserID as WorkforcePersonUserID, //Mandatory
_AssignmentKeyMap.WorkAssignmentDataSource as WorkAssignmentDataSource,
_BuPaIdentification.WorkAssignmentBusinessPartner as WorkAssignmentBusinessPartner,
_AssignmentKeyMap.BusinessPartner as Person,
_WorkforcePersonBP.BusinessPartnerUUID as PersonUUID,
_AssignmentDetailsForKeyDate.CompanyCode as CompanyCode, //select only first one
_AssignmentDetailsForKeyDate.Country2DigitISOCode as WorkAssignmentCountryISOCode,
_BPUsrRole.RoleCategory as RoleCategory,
case _BPUsrRole.BasicRoleCategory
when ''
then _BPUsrRole.RoleCategory
else
_BPUsrRole.BasicRoleCategory
end as BasicRoleCategory,
_BPUsrRole.BusinessPartnerRole as BusinessPartnerRole,
cast( '' as bum_wf_employment_situation preserving type ) as EmploymentSituation,
cast( ' ' as boolean preserving type ) as BusPartRelshpSupplierIsVisible,
@Semantics.systemDateTime.lastChangedAt: true
cast (dats_tims_to_tstmp( _WorkAssignmentBP.CreationDate,
_WorkAssignmentBP.CreationTime,
abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) as vdm_lastchangedon) as CreationDateTime,
cast ( '' as abap.char(10)) as BusinessPartnerRelshpSupplier,
cast ( '' as abap.char(100)) as BusinessPartnerName,
// Fields for DCL
@Semantics.booleanIndicator
_AssignmentKeyMap.IsBlocked as IsBlocked,
@Semantics.booleanIndicator
_WorkAssignmentBP.IsBusinessPurposeCompleted as IsBusinessPurposeCompleted,
_WorkAssignmentBP,
_WorkforcePersonBP,
_WorkAssgmtSrvcCostLvl,
_BPRltnShipSupplier,
_WorkAssgmtAltCostAssgmt,
// _WorkAssignmentPayment,
// _WorkAssgmtPrivateAddress,
_WorkforcePerson,
_WorkAssignmentDetails,
_AssignmentDetailsForKeyDate,
_CompanyCodeText,
_BPUsrRoleText
// _SupplierBP
// _BPDataControllerUsage
}
where
_AssignmentKeyMap.BusinessPartner is not initial
and(
R_WorkAssignmentKeyMapOldModel.NumberOfWorkAssignments <= 1
or R_WorkAssignmentKeyMapOldModel.NumberOfWorkAssignments is null
)