2009 May 29 11:53 AM
hi,
I am using the following statement :
SELECT fname
FROM z3af_hcp INTO TABLE lt_select_list
WHERE fname LIKE lv_first_name.lv_first_name is a variable which contains value something like a%, ab%, A%.
I want a search criteria which is not case sensitive. Plz suggest.
Regards
Pankaj Aggarwal
hi,
I am using the following statement :
SELECT fname
FROM z3af_hcp INTO TABLE lt_select_list
WHERE fname LIKE lv_first_name.lv_first_name is a variable which contains value something like a%, ab%, A%.
I want a search criteria which is not case sensitive. Plz suggest.
Regards
Pankaj Aggarwal
2009 May 29 11:57 AM
firstly dat is dependent upon the domain of the data element.
there is a check box in the domain in the domain which when clicked enables the field as case sensitive.
as i can see u are using a ztable u can very well use a domain of ur choice to make the domain not case sensitive if it case sensitive now.
and if it is not case sensitive then what ever u pass in that variable it will automatically be considered as non case sensitive..
Edited by: soumya prakash mishra on May 29, 2009 12:58 PM
2009 May 29 12:04 PM
2009 May 29 12:07 PM
hi,
You can use 'CA' comparision operator.
Contains Any: True, if operand1 contains at least one character from operand2. Upper/lower case and trailing blanks are taken into account for both operands.
sample code for your reference.
data:begin of itab OCCURS 0,
matnr type makt-matnr,
maktx type makt-maktx,
end of itab.
select matnr maktx
into table itab
from makt.
loop at itab where maktx ca 'A'.
write 😕 itab-matnr, itab-maktx.
endloop.
hope this solves your issue.
2009 May 29 12:10 PM
is the domain case sensitive? please check and let us know first.
in general fname is of domain type : FDNAME
which is not case sensitive... so no need to worry about case as for me
Edited by: soumya prakash mishra on May 29, 2009 1:11 PM
2009 May 29 1:02 PM
domain is case sensitive...
plz suggest what i can use except like...
2009 May 29 1:10 PM
hi,
Either remove the tick of case sensitive from domain or can use the sample code given above.
2009 May 29 1:06 PM
It is NOT POSSIBLE in opensql to have non-case sensitive selects. Where SAP have provided functionality that looks like this, they've added a field for searching, which has the contents of the desired fields, in UPPER CASE.
You must add a field to z3af_hcp, e.g. fname_upper, which contains the values in fname but in upper case. You must make sure it is populated.
Then you can use:
TRANSLATE lv_first_name TO UPPER-CASE.
SELECT fname
FROM z3af_hcp INTO TABLE lt_select_list
WHERE fname_upper LIKE lv_first_name.
matt
Edited by: Matt on May 29, 2009 2:09 PM
2009 May 29 2:52 PM
Depending on your database, you can use native SQL to achieve this directly.
Rob
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |