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

need to validate selection screen parameter valus

Former Member
0 Likes
2,716

Hi all,

we have a requirement to validate parameter values ,

parameter values should be less than or equal to 12 and should accept 2 decimals .

how to declare parameter?

eg: 11.34, 12.00

regards

sridhar

1 ACCEPTED SOLUTION
Read only

Former Member
1,192

Hi,

Try the following



parameters: p_in(5) type p decimals 2.

at selection-screen on p_in.

if not p_in <= 12.
    message e398(00) with 'Enter a value less than 12' .
endif.

Regards,

Vik

8 REPLIES 8
Read only

Former Member
0 Likes
1,192

HI,

Use AT SELECTION-SCREEN Event for validation.

Secondly, use parameter as m_amount type p decimals 2.

regds,

Anil

Read only

0 Likes
1,192

Yes you are right ,

I need to restrict the value to 12 before decimal place in selection screen

system should not allow to user to enter greater than 12 before decimal places.

Read only

0 Likes
1,192

Hi Sridhar,

To restrict to 12 decimals use the following write statement in selection screen.

Write:/<F> decimals 12.

Hope it helps

Regards,

Pavan.

Read only

former_member585060
Active Contributor
0 Likes
1,192
PARAMETERS : p_amount TYPE p DECIMALS 2.

AT SELECTION-SCREEn ON p_amount.

IF .....
MESSAGE ...
ENDIF.
Read only

Former Member
1,193

Hi,

Try the following



parameters: p_in(5) type p decimals 2.

at selection-screen on p_in.

if not p_in <= 12.
    message e398(00) with 'Enter a value less than 12' .
endif.

Regards,

Vik

Read only

Former Member
0 Likes
1,192

Hi,

AT SELECTION-SCREEN .

*To Validate the selection screen

PERFORM screen_validate .

FORM screen_validate .

IF p_data CA '0123456789' AND

p_data >= 12.00 .

ELSE.

MESSAGE e000(zp) WITH text-008 .

ENDIF.

Thanks

Ashu

Read only

0 Likes
1,192

Helloo dude,

Please close the thread once u got the required answer :).

Tnx,

Joe

Read only

Former Member
0 Likes
1,192

should accept 2 decimals .

PARAMETERS : p1 type p DECIMALS 2.

this automatically comes with validation.

and for less than 12, keep logic in at selection-screen event.

both AT SELECTION-SCREEN. and AT SELECTION-SCREEN. on p1 works.

AT SELECTION-SCREEN.
  IF p1 > 12.
    MESSAGE 'Provide values less than 12' type 'E'.
  ENDIF.

and

AT SELECTION-SCREEN ON p1.
  IF p1 > 12.
    MESSAGE 'Provide values less than 12' type 'E'.
  ENDIF.

the difference between these tow is the later displays the error on that particular field (useful when you have multiple fields in selection screen)

hope this helps.

Somu

Edited by: soumya prakash mishra on Jul 31, 2009 8:01 AM