SAP Knowledge Base Article - Public

3736601 - Error 400 Bad request when using asOfDate filter in a navigation - OData API SuccessFactors

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

  1. Go to Integration Center.
  2. Edit an integration based on a non-effective-dated entity where for a effective-dated entity “asOfDate” is added as a direct filter.
  3. 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:

  1. Edit the integration (or create a new one based on Background_Documents)
  2. Go to the Filters section
  3. Instead of adding "Company" (or Business Unit, Cost Center, etc. from EmpJob) as a direct filter field, click "Add Calculated Filter"
  4. Configure the equivalent filtering logic inside the calculated filter
  5. 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

Product

SAP SuccessFactors HCM Suite all versions