‎2007 Feb 05 11:33 AM
hi
if am giving some value for a variable as input, i need to check if any particular letter is present in that or not how can i check that
for example if my input is 'ksjdfkaskdfj' i need to check whether 'a' is present in my input how do i do that using wat command
‎2007 Feb 05 11:36 AM
data : v_str(25) value 'ksjdfkaskdfj'.
search v_str for 'a' .
if sy-subrc eq 0.
write : / 'character a is found'.
endif.
Message was edited by:
Chandrasekhar Jagarlamudi
‎2007 Feb 05 11:38 AM
Hello Varalakshmi
You can simply use the <b>'CA'</b> (= contains any) operator, e.g.:
TRANSLATE my_variable TO UPPER CASE. " if lower case is not relevant
IF ( my_variable CA 'A' ).
result = abap_true. " = 'X'
ELSE.
result = abap_false. " = ' '
ENDIF.Regards
Uwe
‎2007 Feb 05 12:18 PM
hey thanks for ur reply guys
now the requirement is if i dont specify the character but instead i need to search for any character in tht variable