cancel
Showing results for 
Search instead for 
Did you mean: 

ODATA can not resolve filter combining AND & OR

0 Kudos

BE: SAP ERP

GW: HUB

ODATA 2.0

Request Example : /sap/opu/odata/SAP/MY_SERVICE/MyEntitySet?$filter=(substringof('0022',Attr1) or substringof('0022',Attr2))

This Request returns an Error (Operatoren der Systemfilter-Abfrageoption können nicht kombiniert werden = The Operators for system filter can not be combined).

- When I use AND instead of OR, then it functions

- When I use OR for same Attribute also works

The Problem is with using OR for different Attributes..

Any Idea or Fix?

Accepted Solutions (0)

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Hi Azad,

OData as such is able to resolve a filter combining or and substringof as I have described in my following blog.

https://blogs.sap.com/2018/06/07/how-to-get-select-options-for-a-filter-that-contains-two-substringo...

The problem is how to handle such a filter Statement when the underlying API being called in the SAP backend only supports select options as input parameters and if you thus want to retrieve select options from the io_tech_request_context object.

lt_filter_select_options = io_tech_request_context->get_filter()->get_filter_select_options().

If this answer has answered your question please click on ✓ Accept.

Regards,

Andre