SAP Knowledge Base Article - Public

3134548 - How to: Deete EmpJob record via UPSERT

Symptom

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

You wish you delete an employee's EmpJob record via an API Upsert

Environment

SAP SuccessFactors OData API

Resolution

With the Upsert operation, the value DELETE can be passed to the operation field to delete the record. Please refer to our internal testing below for illustration:

1) Query the employee's record beforehand, we will delete the one with the 2015 date:

2) Perform the UPSERT

Operation: Upsert
HTTP Method: POST
URI https://<API-Server>/odata/v2/upsert

Payload:

{
 "__metadata": {
 "uri": 
"EmpJob(seqNumber=1L,startDate=datetime'2015-02-02T00:00:00',userId='106011')"
 },
 "operation": "DELETE",
 "eventReason": "DATACHG"
}
 


3. Obtain successful result:
 
 
4. Query record again and observe the 2015 one was deleted:
 
 

See Also

OData Reference Guide

Keywords

EmpJob, UPSERT, delete, API, OData , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HXM Suite all versions