P_EmployeePositionOP

DDL: P_EMPLOYEEPOSITIONOP SQL: PEMPPOSOP Type: view BASIC

P_EmployeePositionOP is a Basic CDS View in SAP S/4HANA. It reads from 5 data sources (I_Employee, hrp1001, P_PDOBJECTRELATION, P_PDRELATION, wfd_d_new_pers) and exposes 10 fields with key field EmploymentInternalID.

Data Sources (5)

SourceAliasJoin Type
I_Employee Employee inner
hrp1001 EmployeeRelation from
P_PDOBJECTRELATION P_PDOBJECTRELATION left_outer
P_PDRELATION relat inner
wfd_d_new_pers switch left_outer

Annotations (11)

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

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY EmploymentInternalID P_PDRELATION ObjectID
begdaasValidityStartDate
enddaasValidityEndDate
PersonnelNumber I_Employee PersonnelNumber
Employee I_Employee Employee
FullName I_Employee FullName
OrganizationalUnit PositionRelation ObjectID
StartDate PositionRelation StartDate
EndDate PositionRelation EndDate
Appointment hrp1001 objid
@AbapCatalog.sqlViewName: 'PEMPPOSOP'
@VDM.viewType: #BASIC
@VDM.private: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
//@EndUserText.label: 'Employee Position for OnPremise'

@AccessControl.personalData.blocking: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true
define view P_EmployeePositionOP as select from    hrp1001                                       as EmployeeRelation

    inner join      P_PDRELATION                                  as relat            on  relat.ObjectID              = EmployeeRelation.sobid
                                                                                      and relat.ObjectType            = 'P'
                                                                                      and //P Person

                                                                                          relat.RelationShipDirection = 'A'
                                                                                      and relat.ReleationShip         = '209'
                                                                                      and relat.RelatedObjectType     = 'CP'
                                                                                      and relat.ObjectID              = EmployeeRelation.sobid
                                                                                      and relat.StartDate             <= $session.system_date
                                                                                      and relat.EndDate               >= $session.system_date
    inner join      I_Employee                                    as Employee         on relat.RelatedObjectID = Employee.PersonnelNumber
    left outer join P_PDOBJECTRELATION(P_ObjectType :'O',
                                      P_RelationShipDirection :'B',
                                      P_RelationShip :'003',
                                      P_RelatedObjectType : 'S' ) as PositionRelation on  EmployeeRelation.objid     = PositionRelation.RelatedObjectID
                                                                                      and PositionRelation.StartDate <= $session.system_date
                                                                                      and PositionRelation.EndDate   >= $session.system_date
    left outer join wfd_d_new_pers as switch on switch.mandt = EmployeeRelation.mandt
{

  key relat.ObjectID            as EmploymentInternalID,
      @Semantics.businessDate.from/to
      EmployeeRelation.begda    as ValidityStartDate,
      @Semantics.businessDate.from/to
      EmployeeRelation.endda    as ValidityEndDate,
      Employee.PersonnelNumber,
      Employee.Employee,
      Employee.FullName,
      PositionRelation.ObjectID as OrganizationalUnit,
      PositionRelation.StartDate,
      PositionRelation.EndDate,
      EmployeeRelation.objid    as Appointment

}
where
      otype = 'S'
  and rsign = 'A'
  and relat = '008'
  and sclas = 'P'
  and begda <= $session.system_date
  and endda >= $session.system_date
  and(
       switch.switch is null
    or switch.switch <> 'NEW'
  )
  
//  union all select from wfd_d_keymap   as wfd_d_keymap

  
//  inner join      P_PDRELATION   as relat   on  relat.ObjectID   = EmployeeRelation.sobid

//  and relat.ObjectType            = 'P'

//  and //P Person

//    relat.RelationShipDirection = 'A'

//  and relat.ReleationShip         = '209'

//  and relat.RelatedObjectType     = 'CP'

//  and relat.ObjectID              = EmployeeRelation.sobid

//  and relat.StartDate             <= $session.system_date

//   and relat.EndDate               >= $session.system_date


//inner join      I_Employee as Employee  on relat.RelatedObjectID = Employee.PersonnelNumber

//left outer join P_PDOBJECTRELATION(P_ObjectType :'O',

//                                      P_RelationShipDirection :'B',

//                                      P_RelationShip :'003',

//                                      P_RelatedObjectType : 'S' ) as PositionRelation on  wfd_d_keymap.WORKER_ID     = PositionRelation.RelatedObjectID

//                                                                                      and PositionRelation.StartDate <= $session.system_date

//                                                                                      and PositionRelation.EndDate   >= $session.system_date

//   inner join          wfd_d_new_pers as switch on wfd_d_keymap.client = switch.mandt

//   {

//    key relat.ObjectID            as EmploymentInternalID,

//      @Semantics.businessDate.from/to

//      wfd_d_keymap.begda    as ValidityStartDate,

//      @Semantics.businessDate.from/to

//      wfd_d_keymap.endda    as ValidityEndDate,

//      Employee.PersonnelNumber,

//      Employee.Employee,

//      Employee.FullName,

//      PositionRelation.ObjectID as OrganizationalUnit,

//      PositionRelation.StartDate,

//      PositionRelation.EndDate,

//     // EmployeeRelation.objid    as Appointment

//     EmployeeRelation.WORKER_ID   as Appointment

//   }

//   

//   where

//switch.switch = 'NEW'

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EMPLOYEE",
"P_PDOBJECTRELATION",
"P_PDRELATION",
"HRP1001",
"WFD_D_NEW_PERS"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/