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

validation on selection screen

Former Member
0 Likes
782

Hi all,

i have a selection screen

on which there are 2 select-options

The user to enter only particular values in that fields if he doesnt a error message is shown.

After that error message the user is forced to

run the program again (this much is working)

i want that even if he enters invalid value,

a error shoould be shown and the field where

he enterd the invalid value should be ready for input again

how to do it??

Regards,

Tarang

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
688

it should automatically happen but if you wish to just input enabled the particular field than use the selection-screen block statements.

Regards

Anurag

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
688

That should be happening automatically if your validations are in the AT SELECTION-SCREEN event.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
688

Can you show your code?

Read only

Former Member
0 Likes
689

it should automatically happen but if you wish to just input enabled the particular field than use the selection-screen block statements.

Regards

Anurag

Read only

Former Member
0 Likes
688

Hi Shah,

do the selection-screen validation.some thing like this

AT SELECTION-SCREEN.

  DATA : L_KUNWE LIKE KNA1-KUNNR.

*--Validate Customer Number
  IF NOT S_KUNWE[] IS INITIAL.
    SELECT SINGLE KUNNR
             FROM KNA1
             INTO L_KUNWE
         WHERE KUNNR IN S_KUNWE.

    IF SY-SUBRC <> 0.
      MESSAGE E000 WITH 'Invalid Customer Number'(002).
    ENDIF.
  ENDIF.

if the user enters the wrong customer number then it will give the error 'Invalid Customer Number' and even selection screen will be there to enter the value.

Thanks

Vikranth Khimavath

Read only

Former Member
0 Likes
688

hi all,

thanks for the replies

Regards,

Tarang

Read only

Former Member
0 Likes
688

Hi tarang,

1. he enterd the invalid value should be ready for input again

For this we have to take care of two things :

a) write code in the event

START-OF-SELECTION

b) use the command

LEAVE LIST-PROCESSING.

2. The code would be somewhat like this.

START-OF-SELECTION.

IF ERROR CONDITION.

<b>MESSAGE 'wrong values' type 'I'.

LEAVE LIST-PROCESSING.</b>

ENDIF.

*---- Write 😕

3. Important thing.

a) Give message type of I,W (not E)

regards,

amit m.