SAP Knowledge Base Article - Public

3386883 - The compensation record is not deleted by performing UPSERT operation on SFOData.EmpCompensation

Symptom

You are performing UPSERT operation on SFOData.EmpCompensation to delete a record as below.

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

HTTP Method: POST

URI: https://<api-server>/odata/v2/upsert

Payload:

{"__metadata": {

        "uri": "EmpCompensation(startDate= datetime'2017-01-01T00:00:00',userId='80300')",

        "type": "SFOData.EmpCompensation"

      },

      "operation": "DELETE",

     "eventReason": "DATACHG"

}

There is no error in response. The status is OK and the editStatus is UPSERTED. However, the record is not deleted.

Environment

SAP SuccessFactors HXM Suite

* OData API

Cause

You have not supplied seqNumber as one of the business keys of EmpCompensation entity in the request payload for performing UPSERT operation. 

Resolution

Include seqNumber in the request payload to uniquely identify the record in order to delete it. Please see the following example.

HTTP Method: POST

URI: https://<api-server>/odata/v2/upsert

Payload:

{"__metadata": {

        "uri": "EmpCompensation(seqNumber=1L,startDate= datetime'2017-01-01T00:00:00',userId='80300')",

        "type": "SFOData.EmpCompensation"

      },

      "operation": "DELETE",

     "eventReason": "DATACHG"

}

Note: Remember to include the required property eventReason in the payload. 

See Also

EmpCompensation, DELETE, UPSERT, Operation, seqNumber, eventReason, compensation, record

Keywords

KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HXM Suite 2305