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

screen validation

Former Member
0 Likes
458

There is input field in the screen . This fields count exists is from the Z table . the field is of numeric type.

By default this input field should be 1 and it should allows user only digit 2-9 else it should give error message .

What should be the code for this & where i should put this code in flow logic or or in user command .

I am new in module command . point is guranted.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
437

Hello,

Do like this.

data: num(1) type n value '1'.

in PAI.

IF NUM LT '2' and NUM GT '9'.

error mesage.

endif.

Cheers,

Vasanth

4 REPLIES 4
Read only

Former Member
0 Likes
438

Hello,

Do like this.

data: num(1) type n value '1'.

in PAI.

IF NUM LT '2' and NUM GT '9'.

error mesage.

endif.

Cheers,

Vasanth

Read only

Former Member
0 Likes
437

You have 2 Requirements.

1. Default value should be 1.

Write the code in PBO event Module init_screen.

MODULE init_screen.

ZFIELD = '1'.

ENDMODULE.

2. Validation for the value should be between 2-9.

Write the code in PAI.

Read only

Former Member
0 Likes
437

Hi Niraj

In your PAI logic, please add this code

FIELD field_name VALUES (between '2' and '9').

Where field_name is your screen field name which you want to validate.

Regards

Ranganath

PS : Reward points for all useful answers !

Read only

Former Member
0 Likes
437

Hi Niraj,

Try this.

> Parameters: p_value type i default 1.

> Data number(15) type n.

> AT SELECTION-SCREEN

> number = p_value.

> if number cn '23456789'.

> message e888 ( sabapdocu ) with 'Wrong Number'.

> Endif.

Plzz reward if it is useful,

Mahi.