Skip to Content
0

Error in special character '#' in OData filter

Mar 10, 2017 at 06:43 AM

61

avatar image

Hi Experts,

I am getting the following error while doing the OData read call from SAPUI5 application.

When I am sending any string (like service) with some entity set its working fine.

Ex- /EtMatnrSet?$filter=Matnr%20eq%27service%27

But when my string contains special character value '#' like (servi#ce) it not reading anything after '#'.

Ex- /EtMatnrSet?$filter=Matnr%20eq%27servi

So, Kindly provide any solution so that I can send special character '#' while doing the OData read call.

Thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

saurabh vakil Mar 10, 2017 at 07:39 AM
0

Use encodeURI() function to first encode the string containing characters like # and then pass it to the filter.

JavaScript encodeURI() Function

Show 3 Share
10 |10000 characters needed characters left characters exceeded

I have tried with encodeURI() function, but it is not working for '#'.

0

For any of these charatcters , / ? : @ & = + $ # use encodeURIComponent() instead.

1

Thank you it worked.

0