11-21-2008 3:21 PM
Hi,
I have a field for which I want to detect a case where if it is null or contains any alphabhet from a to z.
For this I have defined a constant:
CONSTANTS: c_valid(26) TYPE c VALUE
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
But I get confused in using CO and CA operator. How can I achieve above logic.
Thanks,
CD
11-21-2008 3:24 PM
11-21-2008 3:24 PM
11-21-2008 3:25 PM
You can use SY-ABCDE instead of defining a constant.
IF field IS INITIAL OR field CA SY-ABCDE.
...
ENDIF.
CA = "contains any".
For detailed explanation of these operands, see ABAP online help for the IF-statement.
Thomas
11-21-2008 3:25 PM
Hello,
Use CA operator.
data: w_valid(26) TYPE c VALUE
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
w_value type char10 value 'Jayant'.
if w_value CA w_valid.
message 'Welcome to SCN' type i.
endif.
Hope it helps.
Thanks,
Jayant