2010 Feb 07 8:28 AM
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.
2010 Feb 07 8:34 AM
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,
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.
2010 Feb 07 8:33 AM
Use the CS (Contains String) Function instead of the LIKE clause within your select
a®
2010 Feb 07 8:44 AM
י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
2010 Feb 07 8:49 AM
2010 Feb 07 8:56 AM
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
2010 Feb 07 9:02 AM
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
a®
2010 Feb 07 8:34 AM
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.
2010 Feb 07 8:49 AM
HI Vinod Vemuru
the field is domain but the lower case is not marked ,
there is different way ?
Regards
James
2010 Feb 07 9:04 AM
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.
2010 Feb 07 8:41 AM
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.
a®
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |