07-24-2018 11:00 AM - edited 02-04-2024 4:34 AM
Hi SDNites,
I have a requirement to consume ODATA API of S4HANA cloud system and the query string should have some wild card characters like '*'. I have tried to use substring and contains function and none of them are working. Can you please advise if the same does not work with S4HANA cloud and are there any other options available.
Regards,
Abhi
Hi Abhishek,
I am not sure if the odata service you are refering to is on version 2 or 4. But if it is on version 2, there is no "contains" function. On version 2 you will have to resort to function "substringof" like the following exemple:
https://services.odata.org/v2/Northwind/Northwind.svc/Customers?$format=json&$filter=substringof('Alfreds', CompanyName) eq true
On version 4.0 there is a rather simpler way of doing so:
https://services.odata.org/v4/Northwind/Northwind.svc/Customers?$format=json&$filter=contains(CompanyName,'Alfreds')
If you are still facing trouble, please let us know the exact service and the uri you are using to perform filtering.
Best Regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.