‎2007 Mar 15 3:36 PM
Hi friends.
I want to check one variable type Numc, if it contains alphabet(either capital or small). I have to raise the message for that.
Please help me.
with regards.
Koteswar.
‎2007 Mar 15 3:40 PM
Hi,
Use the function module NUMERIC_CHECK.
Exx
DATA: S_STRING TYPE STRING.
DATA: DDIC_TYPE TYPE DD01V-DATATYPE.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = S_STRING
IMPORTING
STRING_OUT = S_STRING
HTYPE = DDIC_TYPE.
IF HTYPE = 'NUMC'.
***OK..
ELSE.
***NOT OK..
ENDIF.
Thanks,
Naren
‎2007 Mar 15 3:41 PM
‎2007 Mar 15 3:45 PM
if v_var CA SY-ABCDE.
message e001(ZZ) with ' Variable contains alphabets'.
endif.
TRANSLATE SY-ABCDE TO lower CASE.
if v_var CA SY-ABCDE.
message e001(ZZ) with ' Variable contains alphabets'.
endif.
‎2007 Mar 23 5:29 AM
hi!
First of all a NUMC variable can't hold a character.it can only accumulate numbers.
Regards,
Neha Bansal.
Message was edited by:
Neha Bansal
‎2007 Mar 23 6:00 AM
hai,
data var(9) type n.
var = '123asd123'.
if var co '1234567890'.
message 'var is numeric' type 'S'.
else.
Message e001(00) 'Var is not numeric'.
endif.
it never give 'Var is not numeric'.
becaz it not allow any char other than number.
regards ,
ananth.
Message was edited by:
ananth