Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Fuzzy search on internal table - is there something similar possible

Peter_Inotai
Active Contributor
0 Kudos

Hi,

I know there is a possibility the SAP HANA DB using fuzzy search via constains( name, :iv_name, fuzzy) syntax.

Is there anything similar possible in an internal table?

I use currently CS (contains string) operator, but it doesn't support any fuzzy functionality.

Any hint is welcome.

Thanks,

Peter

8 REPLIES 8

Sandra_Rossi
Active Contributor

I don't know the algorithm behind "fuzzy", but there is possibly the ABAP distance function (not specific to internal tables).

Peter_Inotai
Active Contributor

sandra.rossi: Thanks for the hint.

I have to admit I never used distance( ) fucntion yet, but I think it would work. Checking demoprogram DEMO_STRING_DISTANCE is quite promising.

emanuel_klenner
Active Participant

You could try using an AMDP method in an ABAP class passing the internal table along as a parameter. In the AMDP method you can use the native HANA SQL to execute the fuzzy search query against the input table.

Peter_Inotai
Active Contributor
0 Kudos

emanuel.klenner: Thanks for the hint, that would also work. Unfortunately I'm still on non-HANA DB (forgot to mention it 😞 )

0 Kudos

Hi Thorsten,

Thanks for the info. Unfortunately I'm not on HANA DB yet, so I cannot use AMDP. 😞

Other problem, that the data is taken from the DB already, shown to the user and then the user has possibility to perform a search there.

Best regards,

Peter

emanuel_klenner
Active Participant
  1. Then the best you might be able to do is a FIND IN TABLE, maybe with a REGEX pattern for the search.

Peter_Inotai
Active Contributor
0 Kudos

Thanks for the hint about "FIND IN TABLE". I didn't think of that, but that could be also an option.