on 02-25-2016 9:38 PM
Hello,
I built an oData service in our backend development system, and I implemented the GET_ENTITYSET method, which just selects the whole table. I am calling the service through a separate SAP Gateway Server. I would like to be able to filter this data in the URL call. When I call the service in the browser, I get the entire table of results, which is to be expected. When I add the filter parameter, I am still getting all of the results, it isn't applying the filter. Any ideas as to why this is? More details below:
Entity Set "DriversSet":
Entity Type "Drivers":
GET_ENTITYSET Method:
Request from Gateway Server (no filter, executes successfully, returns as expected):
Request from Gateway Server (added filter, executes successfully, but does not actually filter any data, returns full results again):
Thanks for your help,
Owen
Gateway Framework does not perform any filter for you.
The implementation has to be done explicitly in the data provider. You need to narrow the result using values available through IT_FILTER_SELECT_OPTIONS in method GET_ENTITYSET.
Logically it is not a good idea to do a default implementation from the Gateway Layer because
you always pull extra data from the DB which is eventually filtered out by Gateway.
Rather than doing it at the framework level , it can be done more efficiently at the place where the data is being selected for example at the SELECT statement or at the BAPI .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And just to add what Atanu has correctly mentioned, I think this confusion is because of the 'Filterable' check-boxes that you have checked. I think that you are in a assumption that if you check these boxes, gateway framework will automatically handle the filters but it is not.
These check-boxes are to well define metadata document and does not handle filtering in service implementation. It is just to define that these are the parameters on which you(developer) has enabled filter.
It is a best practice to well define metadata document as there are some tools(like MS Excel Add-in for gateway) which rely on metadata document to enable/disable certain operations.
Regards,
Ekansh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Owen,
That's too skeptical,Assuming that you are using BAPI mapped for the Read and Query operation.... Can you show us the mapping to data source in service builder.
If I would be you, I would firstly check if BAPI working fine in se37 tcode and running and testing it.
if yes then clear cache and check again from Gateway client for the same.
Generally clearing the cache help and works many times.
Hope this was helpful.
Regs,
PG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Question is answered, but hope below could help:
https://blogs.sap.com/2016/05/31/odata-service-development-with-sap-gateway-code-based-service-devel...
Add support for $filter to your code
could also help:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.