I_EmployStatDet

DDL: I_EMPLOYSTATDET SQL: IEMPLOYSTATDET Type: view BASIC Package: VDM_SHCM_EMPLOYEE

Employment status

I_EmployStatDet is a Basic CDS View that provides data about "Employment status" in SAP S/4HANA. It reads from 4 data sources (wfd_d_assgmt, wfd_d_assgmtdets, P_WFD_GET_MINEPERNR, wfd_d_keymap) and exposes 6 fields with key fields EmploymentInternalID, StartDate. Part of development package VDM_SHCM_EMPLOYEE.

Data Sources (4)

SourceAliasJoin Type
wfd_d_assgmt assgmt inner
wfd_d_assgmtdets assgmtdets from
P_WFD_GET_MINEPERNR mainEmployment inner
wfd_d_keymap wfd_d_keymap inner

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName IEMPLOYSTATDET view
VDM.viewType #BASIC view
EndUserText.label Employment status view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MASTER view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY EmploymentInternalID wfd_d_assgmtdets workforce_assgmt_id
KEY StartDate wfd_d_assgmtdets start_date
EndDate wfd_d_assgmtdets end_date
PersonnelNumber wfd_d_keymap central_person
EmploymentStatus wfd_d_assgmtdets employment_status
PersonWorkAgrmtAuthznGrpg
@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 wfd_d_assgmtdets    as assgmtdets
    inner join   wfd_d_assgmt        as assgmt         on  assgmt.workforce_assgmt_id =       assgmtdets.workforce_assgmt_id
                                                       and assgmtdets.end_date        between assgmt.start_date and assgmt.end_date
    inner join   wfd_d_keymap        as wfd_d_keymap   on assgmt.workforce_assgmt_id = wfd_d_keymap.workforce_assgmt_id

  //    inner join   WFD_TF_EmploymentMinPernr( p_client : $session.client ) as mainEmployment on  mainEmployment.PersonnelNumber = wfd_d_keymap.business_partner_id

  //                                                                                           and mainEmployment.mandt           = $session.client

    inner join   P_WFD_GET_MINEPERNR as mainEmployment on mainEmployment.PersonnelNumber = wfd_d_keymap.business_partner_id
{
  key assgmtdets.workforce_assgmt_id    as EmploymentInternalID,

      @Semantics.businessDate.from
  key assgmtdets.start_date             as StartDate,

      @Semantics.businessDate.to
      assgmtdets.end_date               as EndDate,
      wfd_d_keymap.central_person       as PersonnelNumber,
      case when assgmtdets.workforce_assgmt_id = mainEmployment.EmploymentInternalID
                                    then 'X'
                                    else ''
                                    end as IsMainEmployment,
      assgmtdets.employment_status      as EmploymentStatus,
      cast('' as vdsk1 )                as PersonWorkAgrmtAuthznGrpg
}
where
      assgmtdets.block_ind    = ''
  and assgmt.block_ind        = ''
  and wfd_d_keymap.block_ind  = ''
  and assgmtdets.company_code != '' 
  and assgmtdets.technical_inactive_ind is initial;


/*
//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

//}