Symptom
You wish to know how you can use OData API to delete a record from an EC entity.
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 HCM Suite
- Employee Central OData API
Resolution
When you want to DELETE or DELIMIT Employee Central entity records using OData API we can do this in the following way:
- EC HRIS entities (Per* & Emp*) have the field "operation" & we can check this using the OData API Data Dictionary:
Example of operation field from OData API Data Dictionary (Entity: PerPersonal)
- We can do a simple UPSERT request with field / value "operation": "DELETE" contained in the request body
Example image from API payload with "operation": "DELETE" and Response (Entity: PerPersonal)
IMPORTANT NOTE: API user must have the below admin API permission granted to perform this action:
- Administrator Permissions > Employee Central API > Employee Central HRIS OData API (editable)
See Also
SAP SuccessFactors API Reference Guide (OData V2) > About Employee Central OData APIs
3596134 - OData API: Prevent EC Entity DELETE operation
SAP SuccessFactors API Reference Guide (OData V2) > purgeType
- purgeType=full can also be used to delete records but this is essentially a REPLACE operation as you are replacing the entity data in the system with the new data you provide in the upsert request
Keywords
DELETE, DELIMIT, HRIS, ODATA, API, EC, record, upsert, operation, admin, purgeType , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To
Product
SAP SuccessFactors HCM Suite all versions
Attachments
| image.png |
| image.png |
SAP Knowledge Base Article - Public