Skip to Content
0

HCI OData Service artifact - How to pass query filters

Jan 13, 2017 at 11:23 AM

704

avatar image

Hello experts,

I'm using HCI Web Application with an Odata Service artifact.

My scenario is:

  • Odata service exposed by HCI mapped 1:1 with an Odata Service exposed by HCP Odata provisioning.
  • Use some filters in a GET request (if i can call for example <hcpHost>/odata/sap/MYSERVICE/MyEntitySet?$filter=Field1 eq 'field1', the service exposed by HCI must support the same query, e.g. <HCIsystem>/gw/odata/SAP/MYSERVICE;v=1/MyEntitySet?$filter=Field1 eq 'field1')

When i bind a query operation, I can successfully add "select" query option, but I can't set filters in any way. Whatever I write in the filters tab, nothing change in the resource path and I can only press ok once, then the button becomes disabled.

If I don't set anything, filters passed in the GET call (…MyEntitySet?$filter=Field1 eq 'field1') are dropped and I can't see them in the backend system.

How can I solve it?

filters.png (29.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Manuel Xiccato May 29, 2017 at 04:46 PM
0

Hi Filippo,

when you're developing an oData service using the HCI Web Application, a pre-defined Integration Flow is created for all query operations: https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/585b5af228e74a3bbe434ab83a606609.html

The "script" step could be used to solve your issue. The standard script (automatically created) manage "$top" and "$skip" oData query options coming from the incoming URI , not the "$filter" one. You could append filter parameters to "oDataURI" header parameter with this code snippet:

After that, filter parameters are saved in the message header. The only thing you have to do is using that header parameter in the OData receiver channel:

Manuel Xiccato


image-037.png (10.1 kB)
image-037.png (10.1 kB)
sdn01.png (53.7 kB)
Share
10 |10000 characters needed characters left characters exceeded
Pavel Penaz
Mar 03, 2017 at 07:39 PM
0

Hi, not sure 100% if this is the direction you want to filter, but can you please review the following extract from documentation: https://proddps.hana.ondemand.com/dps/d/preview/93810d568bee49c6b3d7b5065a30b0ff/2015.03/en-US/frameset.html?3b52ea0b3973478094931f399f6c5696.html - section 11 on the page.

Hope this helps, let me know.

All the best.
Pavel

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

Hi Pavel,

URL you posted isn't working anymore, if your solution is different from what I post, could you please update the URL?

Thank you so much,

Manuel Xiccato

0