Symptom
eAn OData API query on User entity results in the return of invalid records, when there are multiple Filter Set conditions with OR conditions with Status field in the filter query.
Example: &$filter= (lastModifiedDateTime ge '2000-01-01' and empInfo/isECRecord eq true) or (status eq 'f' and empInfo/startDate ge '2025-2-11' and empInfo/startDate le '2025-2-13') , this filter set query fetches Invalid Employee with all the status but both the 1st filter set (lastModifiedDateTime ge '2000-01-01' and empInfo/isECRecord eq true) and 2nd Filter Set (status eq 'f' and empInfo/startDate ge '2025-2-11' and empInfo/startDate le '2025-2-13') individually won't fetch these employees
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 HXM Suite
- Integration
- ODATA API
Cause
The issue arises when using the 'or' condition in the query, which ignores the implicit status filter rule.
Resolution
A query without $filter or key predicate will only return active users in status t and T for User entity. It works like an implicit status filter with t and T only.
That is why the inactive user is NOT returned in the query.
Example
(lastModifiedDateTime ge '2000-01-01' and empInfo/isECRecord eq true)
means
(lastModifiedDateTime ge '2000-01-01' and empInfo/isECRecord eq true and status in 't', 'T')
However when you use OR condition, you are using status as one of filter conditions directly in one of the Filter set which breaks the implicit filter rule. So implicit status filter doesn't exist any more. Hence the Status filter rule gets updated as status in 't', 'T' ,'f', 'F' , 'e' ,'d:
Example
(lastModifiedDateTime ge '2000-01-01' and empInfo/isECRecord eq true) or (status eq 'f' and empInfo/startDate ge '2025-2-11' and empInfo/startDate le '2025-2-13')
means
(lastModifiedDateTime ge '2000-01-01' and empInfo/isECRecord eq true and status in 't', 'T' ,'f', 'F' , 'e' ,'d') or (status eq 'f' and empInfo/startDate ge '2025-2-11' and empInfo/startDate le '2025-2-13')
In case you still want to return only active status in your first half condition, you may add status in 't', 'T' to your first half and condition query
(lastModifiedDateTime ge '2000-01-01' and empInfo/isECRecord eq true and status in 't', 'T') or (status eq 'f' and empInfo/startDate ge '2025-2-11' and empInfo/startDate le '2025-2-13')
See Also
Keywords
OData API, inactive user, filter criteria, status filter, Invalid Status employee record, User, ODATA, implicit status filter, Status , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT-API , API & Adhoc API Framework , LOD-SF-INT , Integrations , Problem