cancel
Showing results for 
Search instead for 
Did you mean: 

Odata Query not working when using '=' symbol

ricky_shaw
Contributor
0 Kudos

Hi,

I have an Odata Query which is working (getting data) fine when i use 'eq' as below:

/sap/opu/odata/SAP/Z*****_01/BPInputsSet?$format=json&$filter= Account eq '800000012341' and Prodtyp eq 'EWR' &$expand=NavtoData1,NavtoData2&$format=json

But when i replace 'EQ' with '='  its throwing error like " 400 : Invalid token detected at position.".etc

How to correct this error?

View Entire Topic
NabiZamani
Contributor
0 Kudos

This is not an error, it’s how it works as per OData spec.

ricky_shaw
Contributor
0 Kudos

Oh really! I see '=' works only for Get Entity queries.

Lets wait for more replies before accepting your answer.

NabiZamani
Contributor
0 Kudos

Imagine these two:

  • $filter= Account eq '800000012341' and Prodtyp eq 'EWR' 
  • $filter= Account = '800000012341' and Prodtyp = 'EWR'

Now think about writing a parser for the second option 😉 Also don't forget how URL params work in your browser.

You could also check the spec to learn that $filter doesn't not allow a '=' (scroll to the section): 4.5. Filter System Query Option ($filter)