cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Filter multiple excludes

0 Kudos

Hi,

I'm currently using the smart filter bar in UI5. I want to exclude multiple items which gives me a oData service like this:

$skip=0&$top=110&$filter=Acc ne '106280' and Acc ne '110000'&$select=*

Which is correct from what I understand but when we call this. In the Backend we get the IT_FILTER_STRING populated but not the IT_FILTER_SELECT_OPTIONS.

This also happens when we call the service from the gateway client. So that rules out an issue with ODP etc.

Any help would be good. When googling I found a few similar issues but no real fix or underlying cause.


Regards,

Jordan.

Accepted Solutions (0)

Answers (1)

Answers (1)

maheshpalavalli
Active Contributor
0 Kudos

Hi jordanryan

"AND" operator for the same property will be treated as a complex filter and will not be available in the it_filter_options table only OR operator for the same property will be populated for multiple values.

You might have to read the filter string and get your filters manually.

Also have a look at these methods, which can convert your filterstring to readable format in internal table, but these belongs to SADL layer, your ABAP version probably will have it.


NEW cl_sadl_gw_condition_parser( )->get_condition( EXPORTING iv_condition = lv_filter_string  IMPORTING et_condition = DATA(lt_condition) ).
// LT_CONDITION WILL STILL NOT BE READABLE.
// CHeck the class CL_SADL_GW_DPC_HELPER, method _GET_FILTER_CONDITION which is using a local handler class to convert the above data to more readable format.

lcl_condition_handler=>condense( EXPORTING it_complex_condition = lt_condition  IMPORTING et_condensed_condition = et_condition ).

Thanks,

Mahesh