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

How to validate a Numeric field ?

Former Member
0 Likes
1,236

How to validate a Numeric field ?

I think u r intensionally posting issues and solving by urself to get the point..is it like that ?

8 REPLIES 8
Read only

Former Member
0 Likes
1,161

we have system variable sy-1234.

loop at itab.

if itab-field CA sy-abcde. "<<<check for any alphabet.

message e001.

endif.

endloop.

Read only

0 Likes
1,161

Numeric field will not accept letters . So no need of validation.

Regards,

Nageswar

Read only

Former Member
0 Likes
1,161

What validation you need?

You might have vlaidation table for the field . Use that table to validate.

Regards,

Nageswar

Read only

Former Member
0 Likes
1,161

Hi,

DATA : v_num TYPE I,

v_cnt TYPE i.

PARAMETERS : P_num TYPE xxxxxxx.

AT SLECTION-SCREEN.

v_num = strlen( p_num ).

DO v_num TIMES.

v_cnt = v_cnt + 1.

IF p_num+0(v_cnt) CA '0123456789'

Number found.

ENDIF.

ENDDO.

Don't forget to reward if useful..

Read only

Former Member
0 Likes
1,161

Hi,

You can use FM NUMERIC_CHECK.

OR



if fieldname  CA sy-abcde.
if sy-subrc NE 0.
message 'Contain Numeric characters' type 'I'.
else.
message 'No Numerics' type 'I'.
endif.
endif.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,161

I Myself solved the issue.

Read only

0 Likes
1,161

I think u r intensionally posting issues and solving by urself to get the point..is it like that ?

Read only

0 Likes
1,161

This fellow from the last 25 posts is asking something and after 2 or 3 replies is

saying that he has done it.

Hey! if you know everything STOP wasting others time...Ithink the moderator should also look into it..