@AbapCatalog.sqlViewName: 'IEMPLOYSTATDET'
@VDM.viewType: #BASIC
@EndUserText.label: 'Employment status'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MASTER
//@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory: #L
//define view I_EmployStatDet as select from P_U_EmployStatDet
define view I_EmployStatDet as select from wfd_tf_EmployStatDet( p_client : $session.client )
{
key EmploymentInternalID,
// @Semantics.businessDate.from/to - Annotation SEMANTICS.BUSINESSDATE.FROM/TO does not exist
@Semantics.businessDate.from
key StartDate,
// @Semantics.businessDate.from/to - Annotation SEMANTICS.BUSINESSDATE.FROM/TO does not exist
@Semantics.businessDate.to
EndDate,
PersonnelNumber, //cast(Employment.PersonnelNumber as /shcm/employee_int_id) as PersonnelNumber,
IsMainEmployment, //cast(Employment.IsMainEmployment as /shcm/main_employmnt_indicator) as IsMainEmployment,
EmploymentStatus,
PersonWorkAgrmtAuthznGrpg
}
//define view I_EmployStatDet as select from P_U_EmployStatDet
//{
// key EmploymentInternalID,
// @Semantics.businessDate.from/to
// key StartDate,
// @Semantics.businessDate.from/to
// EndDate,
// PersonnelNumber, //cast(Employment.PersonnelNumber as /shcm/employee_int_id) as PersonnelNumber,
// IsMainEmployment, //cast(Employment.IsMainEmployment as /shcm/main_employmnt_indicator) as IsMainEmployment,
// EmploymentStatus,
// PersonWorkAgrmtAuthznGrpg
//}
//as select from /shcm/hrp5090 as details
//
//association[0..1] to P_EmploymentCl as XM on
// details.objid = XM.EmploymentInternalID and
// details.begda <= XM.EndDate and
// details.endda >= XM.StartDate
//
// {
//
// // key cast(details.objid as PERNR_D) as EmploymentInternalID,
// key details.objid as EmploymentInternalID,
// @Semantics.businessDate.from/to
// key details.begda as StartDate,
// @Semantics.businessDate.from/to
// details.endda as EndDate,
// XM.PersonnelNumber,
// XM.IsMainEmployment,
// details.status as EmploymentStatus
//}
//
//union all
// as select from pa0000 as it0000
// inner join pa0001 as it0001 on it0000.pernr = it0001.pernr
// and it0001.sprps <> 'X'
// and it0000.endda between it0001.begda and it0001.endda
// association[0..1] to P_EmploymentOp as Employment on it0000.pernr = Employment.EmploymentInternalID
//
//{
// key it0000.pernr as EmploymentInternalID,
// @Semantics.businessDate.from/to
// key it0000.begda as StartDate,
// @Semantics.businessDate.from/to
// it0000.endda as EndDate,
// Employment.PersonnelNumber as PersonnelNumber, //cast(Employment.PersonnelNumber as /shcm/employee_int_id) as PersonnelNumber,
// Employment.IsMainEmployment as IsMainEmployment, //cast(Employment.IsMainEmployment as /shcm/main_employmnt_indicator) as IsMainEmployment,
// case it0000.stat2
// when '3' then '1'
// else '0'
// end as EmploymentStatus ,
// it0001.vdsk1 as PersonWorkAgrmtAuthznGrpg
//}
/*+[internal] {
"BASEINFO":
{
"FROM":
[],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/