SELECT OPTIONS VALIDATIONS

CODE:

TABLES : mara.

SELECTION-SCREEN BEGIN OF BLOCK bl.
SELECT-OPTIONS : so_matnr FOR mara-matnr.
SELECTION-SCREEN END OF BLOCK bl.

AT SELECTION-SCREEN.

IF so_matnr[] IS INITIAL.
MESSAGE 'SELECT OPTION IS EMPTY' TYPE 'I'.
ELSE.
SELECT SINGLE matnr FROM mara WHERE matnr IN @so_matnr INTO @DATA(lv_somatnr).
IF sy-subrc <> 0.
MESSAGE 'MATERIAL NUMBER NOT FOUND IN MARA' TYPE 'I'.
ENDIF.
ENDIF.

output screen :

in order to validate it let us take 2 cases :

  • case 1: empty input
  • case 2: invalid input

CASE 1 : EMPTY INPUT

POST EXECUTING THIS POP UP WILL BE SHOWN :

CASE 2 : INVALID INPUT

POST EXECUTING THIS POP UP WILL BE SHOWN :

NOTE : THIS CODE IS JUST FOR DEMONSTRATION PURPOSE , YOU CAN MAKE THE CHANGES ACCORDING TOP YOUR REQUIREMENTS

Be the first to comment

Leave a Reply

Your email address will not be published.


*