Skip to Content
0

UI5 filtering on odata model mutiple field with or

Feb 08, 2017 at 05:23 PM

135

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Dominique Pierre Feb 13, 2017 at 02:37 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Christophe Drancourt Feb 24, 2017 at 01:30 PM
0

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.

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

Well AFAIK this is the only way to do it.

0