Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

select-option help needed

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.

Tags:
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question