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

Search

Former Member
0 Likes
937

Hi experts,

I have to look for employees in the table PA0002 by name and first name.

I need that the searching without taking into account the accents, for example the results for 'JUAN' and 'JUÁN' must be the same.

Rigth now I have the following code:

data l_nombre type string.

l_nombre = 'JUAN'

and in PA0002 I have an employee whose name is JUÁN

if I do

select *

from pa002

where vorna like l_nombre.

I get 0 matches and I shouid get the the employee 'JUÁN'.

Thanks.

Hi experts,

I have to look for employees in the table PA0002 by name and first name.

I need that the searching without taking into account the accents, for example the results for 'JUAN' and 'JUÁN' must be the same.

Rigth now I have the following code:

data l_nombre type string.

l_nombre = 'JUAN'

and in PA0002 I have an employee whose name is JUÁN

if I do

select *

from pa002

where vorna like l_nombre.

I get 0 matches and I shouid get the the employee 'JUÁN'.

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
838

I don't know of this will work, but you can try the fileds NCHMC and VNAMC instead of NACHN and VORNA. At least they're already in upper case. So this will at least eliminate that problem. And there is a secondary index on these fields, so that will improve performance.

After doing some testing, this suggestion will not work.

Rob

Edited by: Rob Burbank on Jun 2, 2011 2:04 PM

Read only

Clemenss
Active Contributor
0 Likes
838

Hi Sara,

first of all: The subject Search is against any rule.

if you search for 'JUAN' you will not find 'JUÁN'.

If you want to allow similar entries, you can select all names and send them through Function module RS_COMPARE_WORDS_SIMILAR.

If it is only about accents, you may create an algorithm that will put a search term like 'JUAN' into a range containing JÚAN, JÙAN,JUAN,JÚÁN, JÙÀN,JÙÀN,..., just all possible combinations.

The algorithm will be recursive: Take a SEARCH term, find next vowel, create all search terms with a variation of the vowel (A,À and À for A) then apply this for all vaiations starting after first vowel. I think in Spanish you have also N and ñ that should be considered.

Regards,

Clemens

Read only

Former Member
0 Likes
838

Hello Sara,

you can do the following: (if table is not very big)

1. Select all the fields of the table INTO it_table

2. REPLACE ALL OCCURRENCES OF 'é' IN it_table WITH 'e'. (repeat for all vowels)

3. SEARCH your name in it_table

See you!

Read only

Former Member
0 Likes
838

Hi,Try Select all into an internal table and then replace all 'À' with 'A' etc. then use Read Table to get the result you want.