SAP Knowledge Base Article - Public

2314969 - Odata API returns data without respecting the date conditions when navigations are used.

Symptom

Odata API doesnt fetch data as present on the UI (successfactors front-end).

Odata API returns older/only as-of-dated information even when the date conditions to a future date are utilized as mentioned in the reference guide.

Environment

Successfactors

Reproducing the Issue

Employee 1400511 was terminated effective 29/02/2016 when he was on Division 40040498 and rehired effective 01/04/2016 into a new division 40040365.

(From date - To date is correctly used here)

https://api5.successfactors.eu:443/odata/v2/PerPersonal?$format=json&$top=5&$select=endDate,personIdExternal,startDate,personNav/employmentNav/jobInfoNav/division&$expand=personNav/employmentNav/jobInfoNav&$filter=personIdExternal%20eq%20'1400511'&fromDate=1900-03-01&toDate=9999-03-16

However API still returns Division 40040498 for the latest timeslice.

Extract from the API response

}, {
"__metadata" : {
"uri" : "https://api5.successfactors.eu:443/odata/v2/PerPersonal(personIdExternal='1400511',startDate=datetime'2016-04-01T00:00:00')", "type" : "SFOData.PerPersonal"
}, "startDate" : "\/Date(1459468800000)\/", "personIdExternal" : "1400511", "endDate" : "\/Date(253402300799000)\/", "personNav" : {
"__metadata" : {
"uri" : "https://api5.successfactors.eu:443/odata/v2/PerPerson('1400511')", "type" : "SFOData.PerPerson"
}, "employmentNav" : {
"results" : [
{
"__metadata" : {
"uri" : "https://api5.successfactors.eu:443/odata/v2/EmpEmployment(personIdExternal='1400511',userId='1400511')", "type" : "SFOData.EmpEmployment"
}, "jobInfoNav" : {
"results" : [
{
"__metadata" : {
"uri" : "https://api5.successfactors.eu:443/odata/v2/EmpJob(seqNumber=1L,startDate=datetime'2016-02-29T00:00:00',userId='1400511')", "type" : "SFOData.EmpJob"
}, "division" : "40040498"
}

Cause

This is because the navigation used here is from an effective-dated entity(PerPersonal) to a non-effective-dated entity(EmpEmployment) and then again to an effective-dated entity(EmpJob).

In such a scenario, the date condition would be lost and the as-of-dated information would be returned.

Resolution

Such navigations are to be avoided. In this case, you could use EmpJob as the root entity then navigate to EmpEmployment and personNav/PerPersonal.

This will retain the date conditions.

 

Keywords

KBA , LOD-SF-INT , SF Integrations - EC Payroll, Boomi/ HCI, API , LOD-SF-INT-API , SF API & Adhoc API Framework , Problem

Product

SAP SuccessFactors HCM Suite 1602 ; SAP SuccessFactors HCM Suite 1605