Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module to validate numeric values

Former Member
0 Likes
4,524

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

2 REPLIES 2
Read only

Former Member
0 Likes
2,073

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

Read only

former_member156446
Active Contributor
0 Likes
2,073

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.