Symptom
Dependent data is also returning along with employee data when querying the PerPersonal API. How to avoid the dependent data?
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
- SAP SuccessFactors HCM Suite
- OData API
Reproducing the Issue
- Run an OData API query in either Integration Center or OData API directly.
- Records are returning with the format "e_y" in their IDs, where "e" represents the Person ID External of the employee and "y" is some other number.
- These are usually dependent records.
- For example: the dependent of an employee with Person ID External = 2 will have a record with Person ID External = 2_d775.
Cause
This happens because PerPersonal entity by default fetches the entire data of employees and dependents.
Resolution
To obtain only employee records in the query result you can use the following filter: $filter=personNav/employmentNav/personIdExternal ne null.
Logic behind this filter
The personNav/employmentNav field has data only for employees where employment information exists. Dependents do not have employment data, so they are excluded by the filter. Regular employees always have employment information, so they are included in the results.
Example in Integration Center
This is the field to be selected in the filter:
The filter will look like this:
Keywords
dependent, dependents, integration center, odata, api, employee central, , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT-INC-ODATA , ODATA API In Integration Center , How To
SAP Knowledge Base Article - Public