cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

syntax for ODATA filter substringof

dany_charbonneau
Product and Topic Expert
Product and Topic Expert
22,394

Hi,

I can read the filter Odata, for instance :

$filter=startswith(FIELDNAME,'ABC')

return option = CP,

Low = ABC*

in the filter internal table in the DPC_EXT

so far so good but I cannot find the correct syntax for the substringof. According to the Odata specifications, the syntax should be :

substringof(string po, string p1)

$filter=substringof(FIELDNAME,'ABC')

but this does not work. Any idea on the correct syntax ?

Thanks !

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Likes

The syntax you are using looks correct.

Have you checked your implementation?

I posted the following blog with regards to more complex statements with substring.

https://blogs.sap.com/2018/06/07/how-to-get-select-options-for-a-filter-that-contains-two-substringo...

Regards,

Andre

Answers (1)

Answers (1)

dany_charbonneau
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Andre,

Thanks for the answer, your blog was pretty useful !

I was using syntax :

substringof(FIELDNAME,'ABC')

when it should be :

substringof('ABC',FIELDNAME)

Now it work like a charm, thanks a lot !

Regards,

Dany

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Likes

Ok. I have overlooked this as well.

Glad to hear that it works now ;-).

Regards,

Andre