10-10-2008 4:45 PM
hello,
i need to check a constantes of 2 character if it's a NUMBER or not ; is there a MF or a method wich do this.
thank you for help.
10-11-2008 12:18 AM
data: var type C value '02'.
if var+0(1) ca sy-abcde and var+1(1) ca sy-abcde.
write: its not a character.
endif.
10-10-2008 4:53 PM
Hi,
You dont need a method or a FM to do this. Jus go with the simple IF stmt.
IF c_num CO '0123456789'.
.....
.....
ENDIF.
10-10-2008 5:27 PM
10-10-2008 7:56 PM
Yes forgot to mention tat. Add a '.' too.
Data: l_num(6) TYPE c value '123.56'.
if l_num CO '0123456789.'.
write 😕 'Success'.
else.
write 😕 'failure'.
endif.
10-10-2008 7:57 PM
10-10-2008 8:05 PM
... and 1234.56.789 would pass.
So the point is that the OP has to decide what his or her numbers should consist of. At that point it will be easy to code.
Rob
10-11-2008 12:18 AM
data: var type C value '02'.
if var+0(1) ca sy-abcde and var+1(1) ca sy-abcde.
write: its not a character.
endif.