SAP Knowledge Base Article - Public

2739477 - Multiple upserts in the same day swapped records sequence - SuccessFactors OData API

Symptom

  •  Multiple upserts in the same day swap records order
  •  We sent two upserts in the same day, and when we look in the UI, the latest record upserted is in the bottom, as it was an old record.

"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 OData API

Reproducing the Issue

  1.  Upsert two times the record for the sample employee "abc".
  2.  Both request payloads contain the field "sequence number = 1;
  3.  Watch the results in UI or integration center;

Cause

When we send the last upsert with the sequence number = 1, the system will understand that this record should be the first and will place the older one in the top, changing the sequence from 1 to 2.

 Sample of request payload that might cause this issue:

[{"__metadata":
{"id":"URL/odata/v2//EmpPayCompRecurring(payComponent='55555',seqNumber=1L,startDate=datetime'',userId='888888')",
"uri":"URL/odata/v2//EmpPayCompRecurring(payComponent='55555',seqNumber=1L,startDate=datetime'',userId='888888')",
"type":"SFOData.EmpPayCompRecurring"},
"currencyCode":"USD",
"frequency":"HOURLY",
"payComponent":"55555",
"paycompvalue":"10",
"seqNumber":"1",
"startDate":"\/Date()\/",
"userId":"888888"}]

Resolution

We should not send the sequence number in the payload. This way, the system will set the last upsert to the higher sequence number. The UI will show always the higher sequence number as the last record.

Sample of the same payload above but fixed without the Sequence number:

[{"__metadata":
{"id":"URL/odata/v2//EmpPayCompRecurring(payComponent='55555',startDate=datetime'',userId='888888')",
"uri":"URL/odata/v2//EmpPayCompRecurring(payComponent='55555',startDate=datetime'',userId='888888')",
"type":"SFOData.EmpPayCompRecurring"},
"currencyCode":"USD",
"frequency":"HOURLY",
"payComponent":"55555",
"paycompvalue":"10",

"startDate":"\/Date()\/",
"userId":"888888"}]

The same issue should be solved by using a full purge upsert (if appliable to your scenario) refer to workbook page 60: SAP SuccessFactors Employee Central OData API: Reference Guide

Note: It's possible to create multiple entries on the same day if you use incremental upsert type.

Keywords

Multiple upserts in the same day swap records order, We sent two upserts in the same day, and when we look in the UI, the latest record upserted is in the bottom, as it was an old record, records swapped upsert. , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , Problem

Product

SAP SuccessFactors HCM suite all versions