P_EmployeeCl
P_EmployeeCl is a Basic CDS View in SAP S/4HANA. It reads from 5 data sources (but000, but100, but0id, /shcm/hrp5091, P_PDOBJECTRELATION) and exposes 32 fields with key field PersonnelNumber.
Data Sources (5)
| Source | Alias | Join Type |
|---|---|---|
| but000 | bp | from |
| but100 | bp_role | inner |
| but0id | bpexid | inner |
| /shcm/hrp5091 | LogDel | inner |
| P_PDOBJECTRELATION | P_PDOBJECTRELATION | inner |
Annotations (4)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.private | true | view | |
| AbapCatalog.sqlViewName | PEMPLOYEECL | view | |
| VDM.viewType | #BASIC | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view |
Fields (32)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PersonnelNumber | pdrelation | ObjectID | |
| EmployeeInternalID | but000 | partner | ||
| Employee | but0id | idnumber | ||
| StartDateasValidityStartDate | ||||
| EndDateasValidityEndDate | ||||
| FormOfAddress | but000 | title | ||
| FamilyName | but000 | name_last | ||
| FirstName | but000 | name_first | ||
| LastName | but000 | mc_name1 | ||
| BusinessPartnerName | but000 | mc_name2 | ||
| GivenName | but000 | name_first | ||
| MiddleName | but000 | namemiddle | ||
| AdditionalFamilyName | but000 | name_lst2 | ||
| AcademicTitle | but000 | title_aca1 | ||
| FamilyNamePrefix | but000 | prefix1 | ||
| Initials | but000 | initials | ||
| FullName | but000 | name1_text | ||
| EmployeeFullName | but000 | name1_text | ||
| CorrespondenceLanguage | but000 | langu_corr | ||
| xsexfwhenXthen2elseendendasGenderCode | ||||
| BusinessUser | ||||
| UserID | ||||
| EmployeeImageURL | ||||
| BusinessPartnerRole | but100 | rltyp | ||
| Person | but000 | persnumber | ||
| BusinessPartnerUUID | but000 | partner_guid | ||
| CreatedByUser | but000 | crusr | ||
| CreationDate | but000 | crdat | ||
| CreationTime | but000 | crtim | ||
| LastChangedByUser | but000 | chusr | ||
| LastChangeDate | but000 | chdat | ||
| LastChangeTime | but000 | chtim |
@VDM.private: true
@AbapCatalog.sqlViewName: 'PEMPLOYEECL'
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_EmployeeCl as select from but000 as bp
inner join P_PDOBJECTRELATION(P_ObjectType :'XE',
P_RelationShipDirection :'A',
P_RelationShip :'332',
P_RelatedObjectType : 'BP' )
as pdrelation
on bp.partner = pdrelation.RelatedObjectID
inner join /shcm/hrp5091 as LogDel on pdrelation.PlanVersion = LogDel.plvar and
pdrelation.ObjectType = LogDel.otype and
pdrelation.ObjectID = LogDel.objid and
LogDel.logical_deleted = '0'
inner join but0id as bpexid on bp.partner = bpexid.partner and
( bpexid.type = 'HCM001' or // HCM001 - Employee ID
bpexid.type = 'HCM030' or // HCM030 - Service Agent
bpexid.type = 'HCM031' ) // HCM031 - Freelancer
inner join but100 as bp_role on bp_role.partner = bp.partner and
( bp_role.rltyp = 'BUP003' or // BUP003 - Employee
bp_role.rltyp = 'BBP005' or // BBP005 - Service Agent
bp_role.rltyp = 'BBP010' ) // BBP010 - Freelancer
// left outer join I_User as User on bp.partner_guid = User.BusinessPartnerUUID
// left outer join /shcm/hrp5092 as EmployeeImage on EmployeeImage.otype = 'XE' and
// EmployeeImage.objid = pdrelation.ObjectID
{
key pdrelation.ObjectID as PersonnelNumber, //Internal stable ID
bp.partner as EmployeeInternalID, //BUPA ID
bpexid.idnumber as Employee, //External PERNR
@Semantics.businessDate.from/to
pdrelation.StartDate as ValidityStartDate,
@Semantics.businessDate.from/to
pdrelation.EndDate as ValidityEndDate,
bp.title as FormOfAddress,
bp.name_last as FamilyName,
bp.name_first as FirstName, //depricated
bp.mc_name1 as LastName, //Search - Use for search only
bp.mc_name2 as BusinessPartnerName, //Search - Use for search only
bp.name_first as GivenName,
bp.namemiddle as MiddleName,
bp.name_lst2 as AdditionalFamilyName,
bp.title_aca1 as AcademicTitle,
bp.prefix1 as FamilyNamePrefix,
bp.initials as Initials,
bp.name1_text as FullName, //depricated
bp.name1_text as EmployeeFullName,
bp.langu_corr as CorrespondenceLanguage, // Association to Language view
case bp.xsexm
when 'X' then '1'
else
case bp.xsexf
when 'X' then '2'
else ''
end
end as GenderCode,
'' as BusinessUser,
'' as UserID,
'' as EmployeeImageURL,
bp_role.rltyp as BusinessPartnerRole,
bp.persnumber as Person,
bp.partner_guid as BusinessPartnerUUID,
bp.crusr as CreatedByUser,
bp.crdat as CreationDate,
bp.crtim as CreationTime,
bp.chusr as LastChangedByUser,
bp.chdat as LastChangeDate,
bp.chtim as LastChangeTime
}
where bp.type = '1'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_PDOBJECTRELATION",
"/SHCM/HRP5091",
"BUT000",
"BUT0ID",
"BUT100"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
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