‎2008 Feb 03 1:05 PM
Hi all.
Can some one please tell me Is there any Function Module to validate only numeric values?
Like in year variable, it can never contain alphanumeric values or special symbols?
Is there any function module to check, wheather the variable contains only numeric values, no alphanumeric value or special symbol?
If there is no as such function module then what is the alternative approach we can take?
Plz help me .
Regards
Dipankar
‎2008 Feb 03 1:19 PM
Function Module NUMERIC_CHECK for Editing and checking numeric fields ( i.e. Num validations)
Check using the Function Module "NUMERIC_CHECK".
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = X
IMPORTING
STRING_OUT = X
HTYPE = H_TYPE.
if h_type = 'CHAR'.
WRITE:/ 'Not Numeric'.
else.
write:/ 'Numeric'.
ENDIF.
REWARDS IF USEFUL
GAURAV J.
Edited by: GAURAV on Feb 3, 2008 2:19 PM
‎2008 Feb 03 3:25 PM
Hi Dipankar
we have system variable sy-1234.
loop at itab.
if itab-field CA sy-abcde. "<<<check for any alphabet.
message e001.
endif.
endloop.