P_N_Employee

DDL: P_N_EMPLOYEE SQL: PNEMPLOYE Type: view BASIC

P_N_Employee is a Basic CDS View in SAP S/4HANA. It reads from 6 data sources and exposes 34 fields with key field PersonnelNumber.

Data Sources (6)

SourceAliasJoin Type
wfd_d_assgmt assgmt inner
I_WorkforcePersonDetermineRole bp_cf_role left_outer
I_WorkforcePersonPastMinRole bp_p_role left_outer
but100 bp_role inner
but0id bpexid left_outer
wfd_d_keymap keymap inner

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PNEMPLOYE view
VDM.private true view
VDM.viewType #BASIC view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
ObjectModel.representativeKey PersonnelNumber view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MASTER view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view

Fields (34)

KeyFieldSource TableSource FieldDescription
KEY PersonnelNumber wfd_d_keymap central_person
Employee but0id idnumber
EmployeeInternalID bp partner
start_dateasValidityStartDate
end_dateasValidityEndDate
FormOfAddress bp title
FamilyName bp name_last
FirstName bp name_first
LastName bp mc_name1
BusinessPartnerName bp mc_name2
GivenName bp name_first
MiddleName bp namemiddle
AdditionalFamilyName bp name_lst2
AcademicTitle bp title_aca1
FamilyNamePrefix bp prefix1
Initials bp initials
FullName bp name1_text
EmployeeFullName bp name1_text
CorrespondenceLanguage bp langu_corr
xsexfwhenXthen2elseendendasGenderCode
BusinessUser
UserID
EmployeeImageURL
rltypendasBusinessPartnerRole
Person bp persnumber
BusinessPartnerUUID bp partner_guid
CreatedByUser bp crusr
CreationDate bp crdat
CreationTime bp crtim
LastChangedByUser bp chusr
LastChangeDate bp chdat
LastChangeTime bp chtim
AuthorizationGroup bp augrp
IsBusinessPurposeCompleted bp xpcpt
@AbapCatalog.sqlViewName: 'PNEMPLOYE'
@VDM.private: true
//@EndUserText.label: 'Employee'

@VDM.viewType: #BASIC
//@Analytics: { dataCategory: #DIMENSION, dataExtraction.enabled: true } //-- DPP change

@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@ObjectModel.representativeKey: 'PersonnelNumber'
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
define view P_N_Employee
  as select distinct from but000                         as bp
    inner join            wfd_d_keymap                   as keymap     on bp.partner = keymap.business_partner_id
    inner join            wfd_d_assgmt                   as assgmt     on assgmt.workforce_assgmt_id = keymap.workforce_assgmt_id
  //    inner join            P_HrRelation                   as relt       on  bp.partner                 = relt.HumRsceRelatedObjectId

  //                                                                       and relt.ObjectType            = 'CP'

  //                                                                       and //CP - Central person

  //                                                                       //    relt.RelationShipDirection = 'B'

  //                                                                      // and relt.ReleationShip         = '207'

  //                                                                      // and //207    Is identical to

  //                                                                           relt.RelatedObjectType     = 'BP' //and

  //  //                                               relt.StartDate <= TodayDate.TodayDate and

  //                                               relt.EndDate >= TodayDate.TodayDate

    left outer join       but0id                         as bpexid     on bp.partner = bpexid.partner
                                                                       and(
                                                                         bpexid.type = 'HCM001'
                                                                         or // HCM001 - Employee ID

                                                                         bpexid.type = 'HCM030'
                                                                         or // HCM030 - Service Agent

                                                                         bpexid.type = 'HCM031'
                                                                       )    // HCM031 - Freelancer


  //  left outer join I_User          as User   on bp.partner_guid = User.BusinessPartnerUUID

    left outer join       I_WorkforcePersonDetermineRole as bp_cf_role on bp_cf_role.EmployeeInternalID = bp.partner
    left outer join       I_WorkforcePersonPastMinRole   as bp_p_role  on bp_p_role.EmployeeInternalID = bp.partner

    inner join            but100                         as bp_role    on bp_role.partner    = bp.partner
                                                                       and(
                                                                         bp_role.rltyp       = 'BUP003'
                                                                         or // BUP003 - Employee

                                                                         bp_role.rltyp       = 'BBP005'
                                                                         or // BBP005 - Service Agent

                                                                         bp_role.rltyp       = 'BBP010'
                                                                       )    // BBP010 - Freelancer

                                                                       and(
                                                                         bp_role.valid_from  = bp_cf_role.ValidityStartDate
                                                                         or bp_role.valid_to = bp_p_role.ValidityEndDate
                                                                       )
  //  left outer join /shcm/hrp5092   as EmployeeImage on EmployeeImage.otype = 'CP' and

  //                                                      EmployeeImage.objid = relt.ObjectID

{
  key keymap.central_person as PersonnelNumber,
      bpexid.idnumber       as Employee,
      bp.partner            as EmployeeInternalID,
      @Semantics.businessDate.from/to
      assgmt.start_date     as ValidityStartDate,
      @Semantics.businessDate.from/to
      assgmt.end_date       as ValidityEndDate,
      bp.title              as FormOfAddress,
      bp.name_last          as FamilyName,
      bp.name_first         as FirstName, //depricated

      bp.mc_name1           as LastName,            //Search - Use for search only

      bp.mc_name2           as BusinessPartnerName, //Search - Use for search only

      bp.name_first         as GivenName,
      bp.namemiddle         as MiddleName,
      bp.name_lst2          as AdditionalFamilyName,
      bp.title_aca1         as AcademicTitle,
      bp.prefix1            as FamilyNamePrefix,
      bp.initials           as Initials,
      bp.name1_text         as FullName, //depricated

      bp.name1_text         as EmployeeFullName,
      bp.langu_corr         as CorrespondenceLanguage,
      case bp.xsexm
        when 'X' then '1'
        else
          case bp.xsexf
            when 'X' then '2'
            else ''
          end
      end                   as GenderCode,
      ''                    as BusinessUser,
      ''                    as UserID,
      ''                    as EmployeeImageURL,

      case
        when bp_cf_role.BusinessPartnerRole is not initial
        then bp_cf_role.BusinessPartnerRole
        else bp_role.rltyp
      end                   as BusinessPartnerRole,
      //    bp_role.rltyp       as BusinessPartnerRole,

      bp.persnumber         as Person,
      bp.partner_guid       as BusinessPartnerUUID,
      bp.crusr              as CreatedByUser,
      bp.crdat              as CreationDate,
      bp.crtim              as CreationTime,
      bp.chusr              as LastChangedByUser,
      bp.chdat              as LastChangeDate,
      bp.chtim              as LastChangeTime,
      bp.augrp              as AuthorizationGroup,
      bp.xpcpt              as IsBusinessPurposeCompleted
}
where
      bp.type          = '1'
  and keymap.block_ind = ''
  and assgmt.block_ind = ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_WORKFORCEPERSONDETERMINEROLE",
"I_WORKFORCEPERSONPASTMINROLE",
"BUT000",
"BUT0ID",
"BUT100",
"WFD_D_ASSGMT",
"WFD_D_KEYMAP"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/