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 case-insensitive.

Former Member
0 Likes
1,177

HI All ,

i want to create program that use search from table but case-insensitive ,

How i can do that ?

Regards

James

SELECT agr_name UP TO iv_limit ROWS

FROM ZROLE

INTO TABLE lt_re_role

WHERE agr_name LIKE lv_search_value.

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
1,108

Hi,

If the database table field's dataelement is case sensitive then the search automatically happens in case sensitive mode.

You don't have to do explicitly.

Thanks,

Vinod.

HI All ,

i want to create program that use search from table but case-insensitive ,

How i can do that ?

Regards

James

SELECT agr_name UP TO iv_limit ROWS

FROM ZROLE

INTO TABLE lt_re_role

WHERE agr_name LIKE lv_search_value.

9 REPLIES 9
Read only

former_member194669
Active Contributor
0 Likes
1,108

Use the CS (Contains String) Function instead of the LIKE clause within your select

Read only

0 Likes
1,108

יHI

when i try to add it to the select insted the like i get this error

"CS" is not a valid comparison operator. comparison operator.

Thanks

James

Read only

0 Likes
1,108

then poosible option my second thread option

Read only

0 Likes
1,108

HI a®s,

there is different option to do that since

I'm not sure about performance aspects since you collect all the data from the table

and than you do the logic .

Thanks and Regards

James

Read only

0 Likes
1,108

This may be my another suggestion.

Can it be create & maintain another field in the table ZROLE with UPPER case value of field agr_name ?

then you make select on that field

This is only a suggestion

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,109

Hi,

If the database table field's dataelement is case sensitive then the search automatically happens in case sensitive mode.

You don't have to do explicitly.

Thanks,

Vinod.

Read only

0 Likes
1,108

HI Vinod Vemuru

the field is domain but the lower case is not marked ,

there is different way ?

Regards

James

Read only

0 Likes
1,108

Hi,

If the definition is not case sensitive, then always the data is stored in CAPS by default.

So what u can do it, translate your string to UPPER CASE and then select.

Place below statement just before your select.

TRANSLATE lv_search_value TO UPPER CASE.

SELECT agr_name UP TO iv_limit ROWS

FROM ZROLE

INTO TABLE lt_re_role

WHERE agr_name LIKE lv_search_value.

Thanks,

Vinod.

Read only

former_member194669
Active Contributor
0 Likes
1,108

Otherwise


SELECT agr_name UP TO iv_limit ROWS
FROM ZROLE 
INTO TABLE lt_re_role
WHERE agr_name ne space.

then


LOOP AT lt_re_role .
IF lt_re_role-agr_name CS v_name.