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

restrict charcter string to numeric values

Former Member
1,058

Hi,

My field type is CHAR and length 10. If enduser enter any character other than numeric values show error enter numeric value only.

but we don't want NUMC data type because if enduser nothing enter it takes 0.because i want to show as space itself not zero.for this requirement i took CHAR data type.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
857

Hi,

Try like this:

if str CA sy-abcde.

message i000(0) with 'enter numeric values only'.

endif.

Regards,

Bhaskar

5 REPLIES 5
Read only

Former Member
0 Likes
857

If sy-abcde <> 0.

error.

endif.

Hope this helps

Regards,

Prashant

Read only

Former Member
0 Likes
857

hi ,

You can use the Fm NUMERIC_CHECK.

Read only

Former Member
0 Likes
858

Hi,

Try like this:

if str CA sy-abcde.

message i000(0) with 'enter numeric values only'.

endif.

Regards,

Bhaskar

Read only

Former Member
0 Likes
857

Hi,

if p_field_value CO '0123456789'.

  • Do Nothing

else.

message 'Enter only digits'.

endif.

Regards,

Rama.

Read only

Former Member
0 Likes
857

Try with :

data: temp TYPE integer value '1548764484'.