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

Validating the input screen

Former Member
0 Likes
784

How to validate the input screen as like the web page screen

Example:

If we are giving the integers in place of characters then it should throw the error like “please use the character fields”. The validation should occur, On spot.

Only after this validation, the cursor should go to the next input field.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
725

Hi,

Declare a Parameter like

parameters: p_str(10).

in the at selection-screen even t write the validation like:

data: p_var(10) value '1234567890'.

if not p_str is initial.

if p_str CS p_var (means if the entered value contains string like numbers)

message e000 with “please use the character fields”.

( instead of CS you can use CA contains any)

endif.

endif.

reward points if useful

regards,

Anji

6 REPLIES 6
Read only

Former Member
0 Likes
725

Hi Vijay,

You can use sy-abcde in this scenario.

Reward with points if this is useful

Regards,

Krishna K.

Read only

Former Member
0 Likes
725

Hi,

using several events for selection screen

<b>At selection screen on vale request,

At selection screen on help request,

At selection screen output, ect</b>

using these events you can validate the selection screen.

for making the screen fields Active and inactive Use

<b>'LOOP AT SCREEN'</b>

Reg,

Hariharan Natarajan

Read only

Former Member
0 Likes
726

Hi,

Declare a Parameter like

parameters: p_str(10).

in the at selection-screen even t write the validation like:

data: p_var(10) value '1234567890'.

if not p_str is initial.

if p_str CS p_var (means if the entered value contains string like numbers)

message e000 with “please use the character fields”.

( instead of CS you can use CA contains any)

endif.

endif.

reward points if useful

regards,

Anji

Read only

former_member632991
Active Contributor
0 Likes
725

Hi,

Write in this event

At Selection-screen on p_field

IF p_field CA '0123456789'.

write ur message here.

endif.

Regards,

Sonika

Read only

Former Member
0 Likes
725

Hi

I dont think, without any event you can check it. At least ENTER is required.

Bcoz cursor movement & even tab key is not recognised as a FCODE.

Sandeep

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
725

Hi,

If you are giving integers, then there might be possiblity that it may be a character.

For ex., if you giving 1 in character,eventhough it is integer it can be a character also.So you cannot validate it.

But if you want to restrict numbers,then you can use the following.But it will work only if you press enter or execute button.

parameters : p_c1(4) type c modif id z1,

p_i type i.

at selection-screen on p_c1.

if p_c1 ca '0123456789'.

message i000.

endif.

Kindly reward points by clicking the star on the left of reply,if it helps.