on ‎2024 Jun 14 4:16 PM
Hi all,
I hope you can help. We are currently calling an API from our s4hana public cloud stack (s4pc), uhm, within the same system. Reason is simple: not all cds views provide the correct functionality and with longtext.....well, you have to go to the api side.
We are able to determine the api path and actually call the api to fetch data, but somehow the filtering does not work correctly, in fact, the provisioning of a key doesn't work.
To give you an idea of the code which actually works when we use the api.sap.com and tryout option:
/sap/opu/odata/sap/API_PRODUCT_SRV/A_ProductBasicText?$filter=Product eq '3'
this results in:
sap/opu/odata/sap/API_PRODUCT_SRV/A_ProductBasicText?$filter=Product%20eq%20%273%27
and that results in:
Now, when we actually call this in abap cloud, the filter is not taken into account. The result is this no matter which filter we pass in the query (random examples of things I tried):
lo_request->set_query( query = '?$filter=(Product eq ''3'')&$format=json' ) (3 has like 4 single quotes)
?$filter=Product eq '3'
DATA(query) = |(Product='3',Language='EN')&$format=json|.
So, we tried the different things we could find on tryout, documentation etc, but no application of the filter.
It always returns the full set of available text without the filter being applied. I tried everything to copy the filter but no results.
The service url it determines based on the comm system/arrangement etc, is this. It does work otherwise we would not get any result.
But the problem is that no matter what, the filter is not taken into account.
In all honesty, I would rather pass the full key so it would look like this, but can't get it to work with the set_query. Any help in that area would be great!
sap/opu/odata/sap/API_PRODUCT_SRV/A_ProductBasicText(Product='3',Language='EN')
We tried to contact (Product='3', Languate='EN') and pass this to the set_query, but that doesn't work. Replacing it using 'eq', doen't work.
Hope you have some ideas!
All the best
Laurens
Request clarification before answering.
Hello Enda,
thanks for the reply. Well, in fact we are calling it through an application (eclipse in this case), but the filter just does not work. Would you be able to provide a contact who has done something like this before?
Kind regards and all the best
Laurens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 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.