Copyright 2024 - BV TallVision IT

When using a SELECT-OPTIONS, a button appears leading to a popup with lists of single values, ranges, exclusions etc. This popup can be manipulated... It's not vey likely to be useful, but you never know.

If you would like to make sure your end user cannot use all the "standard" options on SELECT-OPTIONS: check out the example.

A very simple or basic main program:

REPORT  ZUPROGRAM.
tables mara.

select-options s_matnr for mara-matnr.

AT SELECTION-SCREEN OUTPUT.

  perform restrict_selop.

The above FORM routine call would be something like:

*---------------------------------------------------------------------
*  Form  restrict_selop
*---------------------------------------------------------------------
*  An example routine where the S_MATNR select option is restricted
*  quite strongly... try it out !
*---------------------------------------------------------------------
form restrict_selop.
* Include type pool SSCR
  TYPE-POOLS sscr.
* Auxiliary objects for filling i_RESTRICT
  DATA: l_optlist TYPE sscr_opt_list,
        l_ass TYPE sscr_ass,
* Define the object to be passed to the RESTRICTION parameter
        l_restrict TYPE sscr_restrict.

  clear: l_optlist, l_ass,
         l_restrict-opt_list_tab[], l_restrict-ass_tab[],
         l_restrict.

  l_optlist-name = 'OPTIONS_SET1'. "Name of the option set
  l_optlist-options-eq = 'X'.
  l_optlist-options-bt = space. "Option disabled
  l_optlist-options-cp = space. "Option disabled
  l_optlist-options-ge = 'X'.
  l_optlist-options-lt = space. "Option disabled
  l_optlist-options-ne = space. "Option disabled
  APPEND l_optlist TO l_restrict-opt_list_tab.

  l_ass-kind = 'S'.       "type: Select-option
  l_ass-name = 'S_MATNR'. "Name of the select option
  l_ass-sg_main = 'I'.
  l_ass-sg_addy = space.
  l_ass-op_main = 'OPTIONS_SET1'. "Option set to apply
  APPEND l_ass TO l_restrict-ass_tab.

  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
      RESTRICTION = l_restrict
    EXCEPTIONS
      OTHERS      = 1.
  if sy-subrc ne 0.
* No action
  endif.

endform.