Skip to Content
1
Oct 10, 2013 at 10:25 AM

?$filter=startswith(CompanyName, 'Alfr') eq true

1273 Views

Hello together,

how implement other people something like this:


Example: Read all functional locations from the system which starts with 9.

Scenario is very simple, the user should have an searchbar (google like, no fuzzy support) to find his funcLocation.

I solved all read request over selects. Classic abab coding, i would do something like that (ignore alternative labeling, to keep it simple)

My rangeTab:

_____________________

I CP 9*

______________________

Select * from iflot where tplnt in rangeTab into....

Problem:
if i access the gateway to do an request like that:

sap/opu/odata/ORI/ACE_SERVICE_SRV/pmFuncLocSet?$filter=Tplnr cp '9*'

Don*t work, because the gateway don't allow CP as filter operation

sap/opu/odata/ORI/ACE_SERVICE_SRV/pmFuncLocSet?$filter=Tplnr eq '9*'

Convert the EQ to CP in the custom coding, if an * is present.
I can`t select an item if the user input the exact entity id (but this problem is releasably)...

sap/opu/odata/ORI/ACE_SERVICE_SRV/pmFuncLocSet?$filter=startswith(Tplrn, '9') eq true and Tplnr eq '9'

i think, this would be the best solution. There is no error by this request, but i could not find any way to access the startswith to build an own range..

It there any other solution available for this kind of problem?

thanks and regards

Benedikt.