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

select-option help needed

Former Member
0 Likes
514

1). DO i need to use

AT SELECTIon-screen.

or

START-OF-SELECTION.

for my select-option validation ?

2). Can I validate my select option ?

IF NOT S_option1 IS INITIAL

PERFORM read_local_file.

ELSE.

MESSAGE i038(zs) WITH ' please enter value in select option1'.

EXIT.

ENDIF.

IF NOT S_option2 IS INITIAL

PERFORM read_local_file.

ELSE.

MESSAGE i038(zs) WITH ' please enter value in select option2'.

EXIT.

ENDIF.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
482

If you want the validation to happen when the user hits ENTER, then you would put that validation logic in the AT SELECTION-SCREEN event, which is the most common way. If, however, you only wanted to validate when the user hits F8 or the "Execute" icon, then you would put this in the begingin of the START-OF-SELECTION event.

And yes, you can validate like that, but make sure that you are pointing to the body of the select-option internal table by using the [].

IF NOT S_option1[] IS INITIAL
PERFORM read_local_file.
ELSE.
MESSAGE i038(zs) WITH ' please enter value in select option1'.
EXIT.
ENDIF.
IF NOT S_option2[] IS INITIAL
PERFORM read_local_file.
ELSE.
MESSAGE i038(zs) WITH ' please enter value in select option2'.
EXIT.
ENDIF.

Regards,

Rich Heilman

3 REPLIES 3
Read only

Former Member
0 Likes
482

Hi,

You need to you AT SELECTION-SCREEN for any selection screen validation.

Yes you can validate the selection option under this event with your code.

Thanks,

Senthil

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
483

If you want the validation to happen when the user hits ENTER, then you would put that validation logic in the AT SELECTION-SCREEN event, which is the most common way. If, however, you only wanted to validate when the user hits F8 or the "Execute" icon, then you would put this in the begingin of the START-OF-SELECTION event.

And yes, you can validate like that, but make sure that you are pointing to the body of the select-option internal table by using the [].

IF NOT S_option1[] IS INITIAL
PERFORM read_local_file.
ELSE.
MESSAGE i038(zs) WITH ' please enter value in select option1'.
EXIT.
ENDIF.
IF NOT S_option2[] IS INITIAL
PERFORM read_local_file.
ELSE.
MESSAGE i038(zs) WITH ' please enter value in select option2'.
EXIT.
ENDIF.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
482

THANKS YOU RICH for YOUR CLEAR EXPLANATION.