P_EmployeePositionOP
Employee Position for OnPremise
P_EmployeePositionOP is a Basic CDS View that provides data about "Employee Position for OnPremise" 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. Part of development package VDM_WFD_WORK_FORCE.
Data Sources (5)
| Source | Alias | Join 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)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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'
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA