‎2008 Jun 14 6:14 AM
hi
i one of the fields in my report, i may get a character value like ABCD and some times only interger like 1234
and some times it may come like 12AE, it depends on case to case
now my question is i have to consider only the interger value i.e. 1234 and the other two cases should not be considered
now how to check if the filed is having character value or integer value
‎2008 Jun 14 6:20 AM
hi! ram reddy
Hope this Helps you.
Try by using relational operator
CS (Contains String)
assign the whole 0 -9 numbers to a variable and raise a check by comparing the assigned variable and the fetched data.
Reward me if its useful.
Regards,
Nagulan
‎2008 Jun 14 7:04 AM
‎2008 Jun 14 7:19 AM
Hi
you can do the following
IF Var1 CA sy-ABCDE and Var1 NA '0123456789'.
it is a Char completely
Elseif Var1 NA Sy-abcde and Var1 CA '0123456789'.
it is completely numeric.
else.
it is Alpha Numeric
endif.'
Regards
Raj
‎2008 Jun 14 7:28 AM
Hi Ram Reddy
Please check if this code helps
REPORT zytest.
DATA:
w_var1(10) TYPE c VALUE 'ABC123',
w_var2(10) TYPE c VALUE '123',
w_var3(10) TYPE c VALUE '1a2b',
w_num(11) TYPE c VALUE '0123456789 '.
IF w_var1 CO w_num.
WRITE:w_var1.
ENDIF.
IF w_var2 CO w_num.
WRITE:w_var2.
ENDIF.
IF w_var3 CO w_num.
WRITE:w_var3.
ENDIF.