[ABAP] SELECT-OPTIONS: Einschränkung der Mehrfachauswahl

* https://www.consolut.com/s/sap-ides-zugriff/d/e/doc/E-SELECT_OPTIONS_RESTRICT/
* http://saptechnical.com/Tips/ABAP/restrict.htm

DATA: lv_matnr TYPE matnr.
SELECT-OPTIONS: so_matnr FOR lv_matnr.

INITIALIZATION.
* Name einer Optionenliste für SELECT-OPTIONS-Restriktionen
  DATA(lv_opt_list) = 'OPT_LIST'.

* Optionenliste
  DATA(it_options) = VALUE sscr_opt_list_tab( ( name       = lv_opt_list
                                                options-eq = abap_true ) ).

* Zuweisungen
  DATA(it_assignment) = VALUE sscr_ass_tab( ( kind    = 'S'                " A(ll), B(lock), S(elect-Option)
                                              name    = 'SO_MATNR'         " Blockname, maximal 20 Zeichen
                                              sg_main = 'I'                " (only) I, SPACE = both
                                              op_main = lv_opt_list ) ).

* Einschränkungen für die SELECT-OPTIONS
  DATA(it_restrictions) = VALUE sscr_restrict( opt_list_tab = it_options
                                               ass_tab      = it_assignment ).

  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
      restriction            = it_restrictions
    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 = 0.

  ENDIF.