@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":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_EmployeePositionOP view