Skip to Content

$filter option in SAP Cloud Integration OData adapter does not work. Invalid filter option

Hi

We are trying to call an OData service in the SAP Backend user a $Filter via OData provisioning

We are able to call the odata service directly using this filter option but when we do it via the OData adapter the adapter crashes with this error.

Request url for HCI:

https://xxxxxx-iflmap.hcisbp.eu1.hana.ondemand.com/http/Webshop/SalesOrderHistory/SalesOrderSet$filter=Customer eq '0050169000'

Response from CPI (the request does not reach the SAP Backend

An internal server error occured: No property "Customer%20eq%20%270050169000%27" exists in type "Z_ORDER_TO_CASH_V1_SRV.SalesOrder" at position 1 in "Customer%20eq%20%270050169000%27"..

It seems as if the adapter tries to find the entire string “Customer eq ‘1234567890’”as a property in the service.

The Filter parameters are dynamically set from the request url using the CamelHTTPQuery header.

I do not think it is a problem with OData provisioning itself since a direct call to the ODP OData service (via http) works fine. Also $top & &skip work fine both in http and odata adapter.

So it seems a problem specifically for the CPI OData adapter.

How can we solve this?

Thanks

Tom

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Dec 01, 2017 at 01:41 PM

    Have you tried

    https://xxxxxx-iflmap.hcisbp.eu1.hana.ondemand.com/http/Webshop/SalesOrderHistory/SalesOrderSet/?$filter=Customer eq '0050169000'
    Add comment
    10|10000 characters needed characters exceeded

  • Dec 01, 2017 at 02:00 PM

    Hi Olegs,

    Thanks, I tried it but the behaviour stays the same alas.

    regards

    Tom

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 06, 2017 at 11:35 AM

    Hi Tom,

    It seems to me there is a ? missing:

    https://xxxxxx-iflmap.hcisbp.eu1.hana.ondemand.com/http/Webshop/SalesOrderHistory/SalesOrderSet$filter=Customereq'0050169000'

    vs

    https://xxxxxx-iflmap.hcisbp.eu1.hana.ondemand.com/http/Webshop/SalesOrderHistory/SalesOrderSet?$filter=Customereq'0050169000'

    Can that be the error?

    Kind regards,

    Martin

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rooijen,

      Could you please elaborate on "whitelist the header named filter". How do you do that in CPI? We have a OData Service Integration Flow (Odata as sender and receiver). We are not able to capture any url parameter in headers. In our case, the below is output of header list

      null accept-language en-US,en;q=0.9,gu;q=0.8

      ODataContext org.apache.olingo.odata2.core.ODataContextImpl@501b8ee3

      odataEntity Customers

      ODataMethod GET_FEED

      odataURI null

      SAP_MessageProcessingLogID AFy_xY3nU4CZP0GUMwfhjwAyYXip s

      criptFile script2.gsh

      scriptFileType groovy

      UriInfo com.sap.gateway.core.ip.odata.OGWUriInfo@da8f72b x-forwarded-for 50.101.108.120