R_WorkforcePersonType

DDL: R_WORKFORCEPERSONTYPE Type: view_entity COMPOSITE Package: WFD_WORKER_FACTSHEET_BL

Type of Workforce Person

R_WorkforcePersonType is a Composite CDS View that provides data about "Type of Workforce Person" in SAP S/4HANA. It has 4 associations to related views. Part of development package WFD_WORKER_FACTSHEET_BL.

Associations (4)

CardinalityTargetAliasCondition
[0..1] R_TotalNumberOfBPRelationship1 _TotalNumberOfBPRelationship _TotalNumberOfBPRelationship.BusinessPartnerCompany = $projection.BusinessPartner and _TotalNumberOfBPRelationship.RelationshipCategory = 'HCM002'
[0..1] R_TotalNumberOfBPRelationship2 _TotalNumberOfBPRelshpLatest _TotalNumberOfBPRelshpLatest.BusinessPartnerPerson = $projection.BusinessPartner and _TotalNumberOfBPRelshpLatest.RelationshipCategory = 'BUR025'
[0..1] R_BPUsrRoleText _BPUsrRoleText _BPUsrRoleText.Role = $projection.BusinessPartnerRole and _BPUsrRoleText.Language = $session.system_language
[0..1] I_BusinessPartner _SupplierBP _SupplierBP.BusinessPartner = $projection.BusinessPartnerRelshpSupplier

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
EndUserText.label Type of Workforce Person view
Metadata.ignorePropagatedAnnotations true view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MIXED view

Fields (12)

KeyFieldSource TableSource FieldDescription
KEY BusinessPartnerUUID R_BPUsrRole BusinessPartnerUUID
KEY BusinessPartnerRole R_BPUsrRole BusinessPartnerRole
BusinessPartner R_BPUsrRole BusinessPartner
RoleCategory R_BPUsrRole RoleCategory
BPRoleCategoryUsageCode R_BPUsrRole BPRoleCategoryUsageCode
BPIdentificationCategory R_BPUsrRole BPIdentificationCategory
BasicRoleCategory R_BPUsrRole BasicRoleCategory
BPUsrRoleValidFromDate R_BPUsrRole BPUsrRoleValidFromDate
BPUsrRoleValidToDate R_BPUsrRole BPUsrRoleValidToDate
_BPUsrRoleText _BPUsrRoleText
_SupplierBP _SupplierBP
_WorkforcePerson _WorkforcePerson
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'Type of Workforce Person'
@Metadata.ignorePropagatedAnnotations: true

@VDM: {
  viewType: #COMPOSITE,
  lifecycle.contract.type: #SAP_INTERNAL_API
}
@ObjectModel.usageType:{
  serviceQuality: #C,
  sizeCategory: #L,
  dataClass: #MIXED
}
@Consumption.dbHints:[ 'USE_HEX_PLAN' ]
define view entity R_WorkforcePersonType
  as select distinct from  R_BPUsrRole
  //    left outer to one join R_BPRelationshipLatest as _BPRelationshipBUR025 on  _BPRelationshipBUR025.BusinessPartnerPerson =  R_BPUsrRole.BusinessPartner

  //                                                                           and _BPRelationshipBUR025.RelationshipCategory  =  'BUR025'

  //                                                                           and _BPRelationshipBUR025.ValidityStartDate     >= R_BPUsrRole.BPUsrRoleValidFromDate

  //                                                                           and _BPRelationshipBUR025.ValidityEndDate       <= R_BPUsrRole.BPUsrRoleValidToDate

  //                                                                           and R_BPUsrRole.BusinessPartnerRole             =  'BBP005'

    left outer to one join I_BPRelationship_2 as _BPRelationshipBUR025 on  _BPRelationshipBUR025.BusinessPartner2 =  R_BPUsrRole.BusinessPartner
                                                                     and _BPRelationshipBUR025.RelationshipCategory  =  'BUR025'
                                                                     and _BPRelationshipBUR025.ValidityStartDate     >= R_BPUsrRole.BPUsrRoleValidFromDate
                                                                     and _BPRelationshipBUR025.ValidityEndDate       <= R_BPUsrRole.BPUsrRoleValidToDate
                                                                     and R_BPUsrRole.BusinessPartnerRole             =  'BBP005'

  association [0..1] to R_TotalNumberOfBPRelationship1    as _TotalNumberOfBPRelationship on  _TotalNumberOfBPRelationship.BusinessPartnerCompany = $projection.BusinessPartner
                                                                                          and _TotalNumberOfBPRelationship.RelationshipCategory   = 'HCM002'

  //Scenario - same WA contains multiple Supplier

  association [0..1] to R_TotalNumberOfBPRelationship2     as _TotalNumberOfBPRelshpLatest on  _TotalNumberOfBPRelshpLatest.BusinessPartnerPerson = $projection.BusinessPartner
                                                                                          and _TotalNumberOfBPRelshpLatest.RelationshipCategory  = 'BUR025'

  association [0..1] to R_BPUsrRoleText                   as _BPUsrRoleText               on  _BPUsrRoleText.Role     = $projection.BusinessPartnerRole
                                                                                          and _BPUsrRoleText.Language = $session.system_language
  association [0..1] to I_BusinessPartner                 as _SupplierBP                  on  _SupplierBP.BusinessPartner = $projection.BusinessPartnerRelshpSupplier
  association        to parent R_WorkforcePersonFactSheet as _WorkforcePerson             on  _WorkforcePerson.PersonUUID = $projection.BusinessPartnerUUID
{
  key   R_BPUsrRole.BusinessPartnerUUID      as BusinessPartnerUUID,
  key   R_BPUsrRole.BusinessPartnerRole      as BusinessPartnerRole,
        R_BPUsrRole.BusinessPartner          as BusinessPartner,
        R_BPUsrRole.RoleCategory             as RoleCategory,
        R_BPUsrRole.BPRoleCategoryUsageCode  as BPRoleCategoryUsageCode,
        R_BPUsrRole.BPIdentificationCategory as BPIdentificationCategory,
        R_BPUsrRole.BasicRoleCategory        as BasicRoleCategory,
        R_BPUsrRole.BPUsrRoleValidFromDate   as BPUsrRoleValidFromDate,
        R_BPUsrRole.BPUsrRoleValidToDate     as BPUsrRoleValidToDate,
        case when _TotalNumberOfBPRelationship.TotalNumberOfBPRelationship > 1
         or
                  _TotalNumberOfBPRelshpLatest.TotalNumberOfBPRelationship > 1
              then cast ( ''  as abap.char(10))
        else
        _BPRelationshipBUR025.BusinessPartner1
        end                                  as BusinessPartnerRelshpSupplier,

        _BPUsrRoleText,
        _SupplierBP,
        _WorkforcePerson
}
where
  R_BPUsrRole.BPRoleCategoryUsageCode = 'B' //Business User