Application Development and Automation 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: 
Read only

Fuzzy Search...

Former Member
0 Likes
480

Hi,

I would like to know how to incorporate a fuzzy search in a field.

For example... if an user enters TEST* in a selection screen field p_var , I should display all the records which has the p_var starting with TEST..... if the user enters TEST than I should display all the records contains the string TEST

Thanks,

Suresh

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
428

Declare the PARAMETER as a SELECT-OPTIONS.

If only one field should be displayed use NO-EXTENSION and NO INTERVALS options.

Then in your program use SELECT (...) WHERE <field> IN <select-option>

(If you use LIKE instruction you will have to map the "*" into "%")

Regards

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
429

Declare the PARAMETER as a SELECT-OPTIONS.

If only one field should be displayed use NO-EXTENSION and NO INTERVALS options.

Then in your program use SELECT (...) WHERE <field> IN <select-option>

(If you use LIKE instruction you will have to map the "*" into "%")

Regards

Read only

Former Member
0 Likes
428

try this,

if p_var CA '*' .

split p_var at '*' into var1 var2.

concatenate 'var1' '%' into var1.

condense var1.

select <fields> from <DB> where

<field> like var1.

else.

concatenate '%' 'var1' '%' into var1.

condense var1.

select <fields> from <DB> where

<field> like var1.

endif.

"<var1> and <var2> are string type variables