R_WorkAssignment

DDL: R_WORKASSIGNMENT Type: view_entity COMPOSITE Package: WFD_WORKER_FACTSHEET_BL

Work Assignment for Worker Factsheet

R_WorkAssignment is a Composite CDS View that provides data about "Work Assignment for Worker Factsheet" in SAP S/4HANA. It reads from 2 data sources (R_WorkAssignmentKeyMap, I_WorkAssignmentValidity) and exposes 33 fields with key fields WorkAssignmentUUID, WorkAssignment. It has 14 associations to related views. Part of development package WFD_WORKER_FACTSHEET_BL.

Data Sources (2)

SourceAliasJoin Type
R_WorkAssignmentKeyMap _AssignmentKeyMap from
I_WorkAssignmentValidity _WrkAssgmtValidity inner

Associations (14)

CardinalityTargetAliasCondition
[0..1] R_BPUsrRoleText _BPUsrRoleText _BPUsrRoleText.Role = $projection.BasicRoleCategory and _BPUsrRoleText.Language = $session.system_language
[1..1] I_BusinessPartner _WorkforcePersonBP _WorkforcePersonBP.BusinessPartner = _AssignmentKeyMap.BusinessPartner
[1..1] I_BusinessPartner _WorkAssignmentBP _WorkAssignmentBP.BusinessPartner = _WrkAssgmtValidity.BusinessPartner
[1..1] I_WorkAssignmentDetail_1 _AssignmentDetailsForKeyDate _AssignmentDetailsForKeyDate.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment and _AssignmentDetailsForKeyDate.WorkforceAssgmtStartDate = _WrkAssgmtValidity.StartDate
[0..1] I_CompanyCode _CompanyCodeText $projection.CompanyCode = _CompanyCodeText.CompanyCode
[0..*] I_BPDataControllerUsage _BPDataControllerUsage $projection.Person = _BPDataControllerUsage.BusinessPartner
[1..*] R_WorkAssignmentDetail _WorkAssignmentDetails
[0..*] R_WrkAssgmtSrvcCostLvl _WorkAssgmtSrvcCostLvl
[0..*] R_SupplierDetail _BPRltnShipSupplier
[0..*] R_WorkAssignmentProject _Project
[0..*] R_WorkAssignmentPayment _Payment
[0..*] R_WorkAssignmentAltCost _AlternateCostObject
[0..*] R_WorkAssignmentPrivateAddress _WorkAssgmtPrivateAddress
[0..*] R_WorkAgreementPaymentMethod _WrkAssgmtPaymentMethod

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
EndUserText.label Work Assignment for Worker Factsheet view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MASTER view

Fields (33)

KeyFieldSource TableSource FieldDescription
KEY WorkAssignmentUUID _WorkAssignmentBP BusinessPartnerUUID
KEY WorkAssignment R_WorkAssignmentKeyMap WorkforceAssignment
IsBlocked R_WorkAssignmentKeyMap IsBlocked
StartDate I_WorkAssignmentValidity StartDate
EndDate I_WorkAssignmentValidity EndDate
WorkforcePersonUserID R_WorkAssignmentKeyMap WorkforcePersonUserID
WorkAssignmentBusinessPartner I_WorkAssignmentValidity BusinessPartner
Person R_WorkAssignmentKeyMap BusinessPartner
PersonUUID _WorkforcePersonBP BusinessPartnerUUID
IsBusinessPurposeCompleted _WorkAssignmentBP IsBusinessPurposeCompleted
CompanyCode _AssignmentDetailsForKeyDate CompanyCode
WorkAssignmentCountryISOCode _AssignmentDetailsForKeyDate Country2DigitISOCode
RoleCategory I_WorkAssignmentValidity RoleCategory
BasicRoleCategory I_WorkAssignmentValidity BasicRoleCategory
BusinessPartnerRole I_WorkAssignmentValidity BusinessPartnerRole
EmploymentSituation
Supplier
BusPartRelshpSupplierIsVisible
_WorkAssignmentBP _WorkAssignmentBP
_WorkforcePersonBP _WorkforcePersonBP
_WorkforcePerson _WorkforcePerson
_AssignmentDetailsForKeyDate _AssignmentDetailsForKeyDate
_CompanyCodeText _CompanyCodeText
_BPUsrRoleText _BPUsrRoleText
_BPDataControllerUsage _BPDataControllerUsage
_WorkAssignmentDetails _WorkAssignmentDetails
_AlternateCostObject _AlternateCostObject
_Project _Project
_Payment _Payment
_WorkAssgmtSrvcCostLvl _WorkAssgmtSrvcCostLvl
_BPRltnShipSupplier _BPRltnShipSupplier
_WorkAssgmtPrivateAddress _WorkAssgmtPrivateAddress
_WrkAssgmtPaymentMethod _WrkAssgmtPaymentMethod
@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