Thank u for ur replies. I don't want to convert the strings to upper/lower case. Is there any way to achieve this.
eg: If it is a password check then is it possible to do this?
even in SAP log on screen also it is not doing case sensitive comparision!!!.
Please read the answer carefully no Upper Case/Lower Case has been used. In Parameters Lower case extension has been used so that string as it is used for comparison without converting to upper case/Lower case. In fact comparison after using Upper Case is wrong.
Yes it is certainly possible. Just copy the following code & have a look at the result.
parameters: w_v1(6) lower Case no-display,
w_v2(6) lower Case no-display.
DATA: w_v3(6) Value 'Vinod',
w_v4(6) Value 'viNod'.
data: w_ii type i.
w_v1 = w_v3.
w_v2 = w_v4.
If w_v1 = w_v2.
Write 'They are Same'.
Write 'They Are not same'.
I hope this helps,
As I tested, by default the equal sign comparison is case-sensitive. That is, below code shows some result:
IF 'a' <> 'A'.
WRITE / 'Comparison is case-sensitive.'.
If you want the opposite behavior, then you need to use some other methods, such as suggested in previous posts, translate to upper case and then compare.
However, SQL SELECT statement comparison is by-default case-insensitive. It is possible to configure the database server to make it case-sensitive, and there are other ways to work around that, too, such as reading the data into an internal table and do ABAP comparison. Internal table loop with where and read by key are both case-sensitive.
Note however, that domains can be defined as case-insensitive. To make comparison always case-sensitive, you should always convert non-string to a string.