cancel
Showing results for 
Search instead for 
Did you mean: 

filter/querry parameters with "or" operation, in odata call

sushant_nath2
Participant
0 Kudos

Hello All,

Hope you are doing good!

I am trying , to pass filter parameters with "or" operation, in odata call to fetch records for a read querry.

PFB read url/querry:

TruckloadOptimizationStatusSet?$filter=(IMaterial eq '149D7B' or IMaterial eq '216F90') and (IQuantity eq 0 or IQuantity eq 0) and (IPlant eq '3601' or IPlant eq '') and (IShipTo eq '12057502' and ITrasGroup eq '0002').

From ui side, the materials and quantities are to be passed, after clicking on "Add to Cart" button as per attached screenshot:

appscreenshot.png

Can anyone please help me, on how to pass the filter parameters, for read operation, especially the IMaterial and IQuantity, from ui/frontend?

BR,

Sushant

0 Kudos

Hi Sushant,

Were you able to resolve this issue, I struck with the same situation. In my OData query is coming under iv_filter_string. Can't convert into LT_FIlter_select.

Thanks

Rajesh

Accepted Solutions (0)

Answers (1)

Answers (1)

ThorstenHoefer
Active Contributor

Hi Sushant, how to cretate a combinded and / or filter is explanined in https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.model.Filter%23constructor

Example: Combining a list of filters either with AND or OR
new Filter({
    filters: [
      ...
      new Filter({
        path: 'Quantity',
        operator: FilterOperator.LT,
        value1: 20
      }),
      new Filter({
        path: 'Price',
        operator: FilterOperator.GT,
        value1: 14.0
      })
      ...
    ],
    and: true
  })

Try to get the where clause in the DPC_EXT Class with the input parameter IO_TECH_REQUEST_CONTEXT

IO_TECH_REQUEST_CONTEXT->GET_OSQL_WHERE_CLAUSE_CONVERT ( )

Best Regards
Thorsten