Symptom
You are using asOfDate as a filter parameter in your query in OData API or Integration Center job, and you are receiving either of the errors below:
- “400 Bad Request”
- "Error Loading Preview Data
class java.lang. String cannot be cast to class java.util.Date (java.lang.String and java.utiLDate are in module java.base of loader 'bootstrap')
Code: ServerErrorException
Status: Internal Server Error
Status Code: 500""
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
- OData API
- Integration Center
Reproducing the Issue
If using Integration Center
- Go to Integration Center.
- Edit an integration based on a non-effective-dated entity where for a effective-dated entity “asOfDate” is added as a direct filter.
- Navigate to “Configure fields”: an error appears.
Or, if using OData API, same example above applies, but you have to execute the query to receive the error.
Cause
The issue occurs when combining the asOfDate parameter with a direct $filter on navigation properties that lead to effective-dated entities (for example, userIdNav/empInfo/jobInfoNav/company) from a non-effective-dated root entity like Background_Documents. This usage is not supported.
Resolution
For now, there is a workaround that can be used for this. However, a later fix is planned for this.
In Integration Center, customers should use a Calculated Filter instead of adding the field (e.g., Company from EmpJob) directly as a filter.
Steps for the workaround in Integration Center:
- Edit the integration (or create a new one based on Background_Documents)
- Go to the Filters section
- Instead of adding "Company" (or Business Unit, Cost Center, etc. from EmpJob) as a direct filter field, click "Add Calculated Filter"
- Configure the equivalent filtering logic inside the calculated filter
- Save and test the integration
For customers using the API directly (Postman/Bruno), the workaround is to either remove the asOfDate parameter or remove the navigation-based filter to effective-dated entity fields from $filter — removing either one will allow the request to succeed.
Example — problematic query:
GET /odata/v2/Background_Documents?$filter=userIdNav/empInfo/jobInfoNav/company eq '1000'&asOfDate=9999-12-31→ 400 Bad Request
Example — workaround (remove asOfDate):
GET /odata/v2/Background_Documents?$filter=userIdNav/empInfo/jobInfoNav/company eq '1000'→ 200 OK
PS: Yes, we plan to fully support this use case in the 2611 release. After 2611, customers will be able to use asOfDate with $filter navigation from non-effective-dated entities to effective-dated entities without any workaround. The fix has already been merged to our master branch.
See Also
Keywords
integration center, background_documents, asofdate, $filter navigation, empjob company, effective-dated, non-effective-dated, configure fields error, odata v2, 400 bad request, calculated filter, background element filter, navigation filter, empjob filter, odata error , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT-INC-ODATA , ODATA API In Integration Center , Problem
SAP Knowledge Base Article - Public