cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass Special Character(&) In Odata Filter Parameter

arunchembra1
Participant

Hello Team,

How to pass Special Charecter ( & ) in the filter URL ?

Is there any alternative solution which we can handle in UI5 code ?

URL : /sap/opu/odata/sap/ZGW_XXX _SRV/AddressSet?$filter=Name eq 'A&B'

While calling the above URL i was getting error "Invalid Token Detected at position" , due to the special character .

Thanks,

Arun

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Just replace & with %26. (Its ASCII code)

It is called as escaping special characters.

Answers (2)

Answers (2)

Pavan_Golesar
Active Participant
0 Kudos

Adding to krishna, As Edm.String are fixed- or variable-length UTF-8 character, %26 is the UTF-8 form of '&'.

Correct me if I'm wrong.

Reference:HTML URL Encoding Reference


Regards,

--PG

Pavan_Golesar
Active Participant
0 Kudos

Hello Arun,

What is the Property type for property Name in AddressSet?

Is it Type="Edm.String ??


I am not sure but, with Edm.String it should work fine.

Let us know.

Regards,

--PG

arunchembra1
Participant
0 Kudos

Yes its Type="Edm.String