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

check quantity field

Former Member
0 Likes
1,049

Hi experts,

Iam trying to check quntity field which is having CHAR24 length.

How can i check whether user enters valid quantity...??

Is there any standard FM existing??

It should accept only following conditions....

1) 1234567890

2) 12345.00

3) should be less than 15 length

should not accept..

1. wild card charecters (!@#$%%^&* ....etc )

2. two periods (12345.00.00)

how can i do that??

reward guaranteed

thanks...

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
716

Hi

Try this:

PARAMETERS: P1(24) TYPE C.

DATA: _NUMBER TYPE P DECIMALS 2.

CATCH SYSTEM-EXCEPTIONS CONVT_NO_NUMBER = 1.
  MOVE P1 TO _NUMBER.
ENDCATCH.
IF SY-SUBRC <> 0.
  WRITE: P1, 'is not number'.
ENDIF.

Max

2 REPLIES 2
Read only

Former Member
0 Likes
717

Hi

Try this:

PARAMETERS: P1(24) TYPE C.

DATA: _NUMBER TYPE P DECIMALS 2.

CATCH SYSTEM-EXCEPTIONS CONVT_NO_NUMBER = 1.
  MOVE P1 TO _NUMBER.
ENDCATCH.
IF SY-SUBRC <> 0.
  WRITE: P1, 'is not number'.
ENDIF.

Max

Read only

0 Likes
716

Hi Max.

Excellent...

It is working very well with your simple code.

Full points alloted...

Thanks

Kaki