*&---------------------------------------------------------------------* *& Report /EUTIN/RESTRICT_SELECT_OPTIONS *& Demo: Restriction of SELECT-OPTIONS parameters *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT /eutin/restrict_select_options. *---------------------------------------------------------------------- *--- global data declarations *---------------------------------------------------------------------- TYPE-POOLS: sscr. CONSTANTS: con_title TYPE sytitle VALUE 'Demo: Restriction of SELECT-OPTIONS parameters', con_arbgb TYPE t100-arbgb VALUE '####################'. *---------------------------------------------------------------------- *--- screen 1000 *---------------------------------------------------------------------- SELECTION-SCREEN BEGIN OF BLOCK sel WITH FRAME TITLE sel. SELECT-OPTIONS: s_arbgb FOR con_arbgb NO INTERVALS. SELECTION-SCREEN END OF BLOCK sel. *---------------------------------------------------------------------- *--- event: initialization *---------------------------------------------------------------------- INITIALIZATION. PERFORM init. *---------------------------------------------------------------------- *--- event: start-of-selection *---------------------------------------------------------------------- START-OF-SELECTION. PERFORM main. *---------------------------------------------------------------------- *--- event: end-of-selection *---------------------------------------------------------------------- END-OF-SELECTION. RETURN. *---------------------------------------------------------------------- *--- subroutines *---------------------------------------------------------------------- *&---------------------------------------------------------------------* *& Form INIT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM init. DATA: ls_restrict TYPE sscr_restrict, ls_opt_list TYPE sscr_opt_list, ls_ass TYPE sscr_ass. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *--- set texts for parameter on selection screen 1000 sy-title = con_title. sel = 'Selections'. %_s_arbgb_%_app_%-text = 'Application Area'. *--- restict SELEC-OPTIONS parameter to EQUAL only CLEAR: ls_restrict, ls_opt_list, ls_ass. ls_opt_list-name = 'EQ'. ls_opt_list-options-eq = 'X'. INSERT ls_opt_list INTO TABLE ls_restrict-opt_list_tab. IF sy-subrc NE 0. MESSAGE e252(s#) WITH sy-repid 'FORM INIT' 'INSERT #1' sy-subrc. ENDIF. ls_ass-kind = 'S'. ls_ass-name = 'S_ARBGB'. ls_ass-sg_main = 'I'. ls_ass-sg_addy = space. ls_ass-op_main = 'EQ'. ls_ass-op_addy = space. INSERT ls_ass INTO TABLE ls_restrict-ass_tab. IF sy-subrc NE 0. MESSAGE e252(s#) WITH sy-repid 'FORM INIT' 'INSERT #2' sy-subrc. ENDIF. CALL FUNCTION 'SELECT_OPTIONS_RESTRICT' EXPORTING restriction = ls_restrict EXCEPTIONS too_late = 1 repeated = 2 selopt_without_options = 3 selopt_without_signs = 4 invalid_sign = 5 empty_option_list = 6 invalid_kind = 7 repeated_kind_a = 8 OTHERS = 9. IF sy-subrc NE 0. MESSAGE e252(s#) WITH sy-repid 'FORM INIT' 'FUNC SELECT_OPTIONS_RESTRICT' sy-subrc. ENDIF. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ENDFORM. " INIT *&---------------------------------------------------------------------* *& Form MAIN *&---------------------------------------------------------------------* *& text *&---------------------------------------------------------------------* FORM main. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RETURN. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ENDFORM. " MAIN *--- The End!