SAP Knowledge Base Article - Public

3481607 - OData API error when deleting record - "java.lang.String cannot be cast to class java.math.BigDecimal"

Symptom

You would like to delete a record from an entity (such as TodoEntryV2), and use below API URL for DELETE operation.

e.g. DELETE  https://api68sales.successfactors.com/odata/v2/TodoEntryV2('123') 

But the API request failed with below 500 error:

  • class java.lang.String cannot be cast to class java.math.BigDecimal (java.lang.String and java.math.BigDecimal are in module java.base of loader 'bootstrap')

Environment

SAP SuccessFactors HCM

  • OData API

Cause

The format to specify the business key in the API URL is not recognized.

Resolution

Please correct the API URL with an accepted format.

For example, you could use one of below API URLs to delete a record for TodoEntryV2.

e.g. https://<API-Server>/odata/v2/TodoEntryV2(123)

      https://<API-Server>/odata/v2/TodoEntryV2(123M)

      https://<API-Server>/odata/v2/TodoEntryV2(todoEntryId=123)

Keywords

SF, Success Factors, 500 Internal Server Error, ServerErrorException, remove , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM Core 2405