SAP Knowledge Base Article - Public

2203412 - SFAPI entity doesn't return historical/future dated timeslices as a query response - SFAPI

Symptom

You have more than one record for an employee's job information.

The SOAP API doesn't return information of all the time records.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • Successfactors

Reproducing the Issue

Let us use EmpJob SFAPI Entity here as an example to understand this article

We have two records for an Employee as seen from the below screenshot

sfapi1_edit.jpg

Let us try to fetch this information via SFAPI

SFAPI Request XML

SELECT person_id_external,start_date, end_date FROM EmpJob WHERE person_id_external = 'XXXX'

SFAPI Response XML

<type>EmpJob</type>
<person_id_external>XXXX</person_id_external>
<start_date>2014-08-08</start_date>
<end_date>9999-12-31</end_date>
</sfobject>
<numResults>1</numResults>
<hasMore>false</hasMore>
<querySessionId>cb2437d7-d327-4e06-a8dc-34da4859151f</querySessionId>
</result>

We observe that the SFAPI has only returned the latest record and did not return the other record.

Cause

  • This entity returns only latest Active timeslice (NOT future dated timeslice) irrespective of whether exmployee is active or inactive.
  • Exceptions: SFAPI entities (excluding Compound Employee API) cannot fetch future dated information ie,it cannot fetch a timeslice with Effective date higher than today's date.
  • Example :If the Start Date of latest time slice is higher than today's date then it would not be considered .

Resolution

This is the expected behavior with SFAPI.

Suggestion  - You may use Odata API to fulfill this requirement.

The below request can be passed as an example for the same employee

odata/v2/EmpJob?$filter=userId%20eq%20'xxxx'&$select=startDate,endDate&$fromDate=1900-01-01&toDate=2999-12-31

The response obtained is attached below.

sfapi2_edit.jpg

Thus we obtain the information from both the records and hence confirm that Odata supports date ranges.

See Also

SAP SuccessFactors HCM Suite SFAPI: Developer Guide

Keywords

Other records not fetched via SFAPI EmpJob SOAP API issue , KBA , LOD-SF-INT-API , API & Adhoc API Framework , LOD-SF-INT , Integrations , Problem

Product

SAP SuccessFactors HXM Suite all versions