R_WORKASSIGNMENT
Work Assignment for Worker Factsheet
R_WORKASSIGNMENT is a CDS View in S/4HANA. Work Assignment for Worker Factsheet. 2 CDS views read from this table.
CDS Views using this table (2)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| C_WorkAssignment_1 | view_entity | projection | CONSUMPTION | Work Assignment for Worker Factsheet |
| R_WorkAssignmentPayment | view_entity | inner | COMPOSITE | Payment for Workforce Person |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'Work Assignment for Worker Factsheet'
@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #SAP_INTERNAL_API
}
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #XL,
dataClass: #MASTER
}
@Consumption.dbHints:[ 'USE_HEX_PLAN' ]
define view entity R_WorkAssignment
as select from R_WorkAssignmentKeyMap as _AssignmentKeyMap
inner join I_WorkAssignmentValidity as _WrkAssgmtValidity on _WrkAssgmtValidity.WorkAssignment = _AssignmentKeyMap.WorkforceAssignment
// inner join R_WorkAssignmentBP as _BuPaIdentification on _BuPaIdentification.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment
// inner join R_BPUsrRole as _BPUsrRole on _BPUsrRole.BusinessPartner = _BuPaIdentification.BusinessPartner
// and _BPUsrRole.BPRoleCategoryUsageCode = _BuPaIdentification.BPRoleCategoryUsageCode
// inner join I_WorkforceAssignment as _WorkforceAssignment on _WorkforceAssignment.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment
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 = _WrkAssgmtValidity.BusinessPartner
// association [1..1] to I_BusinessPartner as _WorkAssignmentBP on _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.BusinessPartner
association [1..1] to I_WorkAssignmentDetail_1 as _AssignmentDetailsForKeyDate on _AssignmentDetailsForKeyDate.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment
and _AssignmentDetailsForKeyDate.WorkforceAssgmtStartDate = _WrkAssgmtValidity.StartDate
// and _AssignmentDetailsForKeyDate.WorkforceAssgmtStartDate = _WorkforceAssignment.WorkforceAssgmtStartDate
//// and _AssignmentDetailsForKeyDate.WorkforceAssgmtStartDate = _BPUsrRole.BPUsrRoleValidFromDate
association [0..1] to I_CompanyCode as _CompanyCodeText on $projection.CompanyCode = _CompanyCodeText.CompanyCode
composition [1..*] of R_WorkAssignmentDetail as _WorkAssignmentDetails
composition [0..*] of R_WrkAssgmtSrvcCostLvl as _WorkAssgmtSrvcCostLvl
composition [0..*] of R_SupplierDetail as _BPRltnShipSupplier
composition [0..*] of R_WorkAssignmentProject as _Project
composition [0..*] of R_WorkAssignmentPayment as _Payment
composition [0..*] of R_WorkAssignmentAltCost as _AlternateCostObject
composition [0..*] of R_WorkAssignmentPrivateAddress as _WorkAssgmtPrivateAddress
composition [0..*] of R_WorkAgreementPaymentMethod as _WrkAssgmtPaymentMethod
//composition [0..*] of ZR_WAADDRESSFACTSHEETTP as _PrivateAddress
association to parent R_WorkforcePersonFactSheet as _WorkforcePerson on $projection.PersonUUID = _WorkforcePerson.PersonUUID
association [0..*] to I_BPDataControllerUsage as _BPDataControllerUsage on $projection.Person = _BPDataControllerUsage.BusinessPartner
{
key _WorkAssignmentBP.BusinessPartnerUUID as WorkAssignmentUUID,
key _AssignmentKeyMap.WorkforceAssignment as WorkAssignment, //PERNR
_AssignmentKeyMap.IsBlocked as IsBlocked,
_WrkAssgmtValidity.StartDate as StartDate,
_WrkAssgmtValidity.EndDate as EndDate,
//_AssignmentKeyMap.WorkAssignmentExternalID as WorkAssignmentExternalID, //User ID Mandatory
_AssignmentKeyMap.WorkforcePersonUserID as WorkforcePersonUserID,
// _BuPaIdentification.BusinessPartner as WorkAssignmentBusinessPartner,
_WrkAssgmtValidity.BusinessPartner as WorkAssignmentBusinessPartner,
_AssignmentKeyMap.BusinessPartner as Person,
_WorkforcePersonBP.BusinessPartnerUUID as PersonUUID,
@Semantics.booleanIndicator: true
_WorkAssignmentBP.IsBusinessPurposeCompleted as IsBusinessPurposeCompleted,
_AssignmentDetailsForKeyDate.CompanyCode as CompanyCode, //select only first one
_AssignmentDetailsForKeyDate.Country2DigitISOCode as WorkAssignmentCountryISOCode,
_WrkAssgmtValidity.RoleCategory as RoleCategory,
_WrkAssgmtValidity.BasicRoleCategory as BasicRoleCategory,
_WrkAssgmtValidity.BusinessPartnerRole as BusinessPartnerRole,
cast( '' as wfd_wf_employment_situation ) as EmploymentSituation,
cast( '' as md_supplier ) as Supplier,
cast( ' ' as boolean ) 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,
_WorkAssignmentBP,
_WorkforcePersonBP,
_WorkforcePerson,
_AssignmentDetailsForKeyDate,
_CompanyCodeText,
_BPUsrRoleText,
_BPDataControllerUsage,
_WorkAssignmentDetails,
_AlternateCostObject,
_Project,
_Payment,
_WorkAssgmtSrvcCostLvl,
_BPRltnShipSupplier,
_WorkAssgmtPrivateAddress,
_WrkAssgmtPaymentMethod
// _WorkAssignmentDetails,
// _PrivateAddress
}
where
_AssignmentKeyMap.BusinessPartner is not initial