cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 filtering on odata model mutiple field with or

Former Member
0 Kudos

Dear all,

I currently have a problem regarding filtering oData model in a search help( Search Event).

I created the search help using the import search help tool in SEGW.

I want the input to filter the search help list on title or description.

My point is nothing is retrieved when I am sending the following url tag:

$filter=(substringof('00',Bukrs)'or'substringof('00',Butxt))

I do have data corresponding to this query in my model. Moreover, I am getting data when sending the following:

$filter=(substringof('00',Bukrs)'and'substringof('00',Butxt))

I could reach debug in my service get_entityset method.

I saw that the intput parameters:

* IT_FILTER_SELECT_OPTIONS was empty

* IV_FILTER_STRING = ( ( substringof ( '00' , Bukrs ) or ( substringof ( '00' , Butxt ) )

=> This causes a tech error making my filtering fail.

I can't understand why the and is working when the or is wrong

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Pierre,

Thanks for your answer. I can indeed do that but I won't be able to use the "standard" auto-generated code for search help contained in my class Z*_DPC.

I can do this in the Z*DPC_EXT without problem by coding and interpreting the value as I want but I would like to use the standard code for a better evolution potential.

pierre_dominique2
Contributor
0 Kudos

Well AFAIK this is the only way to do it.

former_member321811
Participant
0 Kudos

Hi,

You have to use IV_FILTER_STRING to filter when using an OR condition. Example:

SELECT * FROM MYTABLE INTO CORRESPONDING FIELDS OF TABLE ET_ENTITYSET
WHERE (IV_FILTER_STRING).

Cheers,

Pierre