If you ever wanted to restrict the possibilities of Select-Options, there is good news.

The FM 'SELECT_OPTIONS_RESTRICT' is the way to go.

 

*# Sortierung-Options restrict to EQ



  DATAL_WA_RESTRICT TYPE SSCR_RESTRICT,
        L_WA_OPTLIST  TYPE SSCR_OPT_LIST,
        L_WA_ASS      TYPE SSCR_ASS.

* Only 'EQ' 
  L_WA_OPTLIST-NAME 'OBJECTKEY1'.
  L_WA_OPTLIST-OPTIONS-EQ 'X'.
  APPEND L_WA_OPTLIST TO L_WA_RESTRICT-OPT_LIST_TAB.

  L_WA_ASS-KIND 'S'.
  L_WA_ASS-NAME 'S_SORT'.
  L_WA_ASS-SG_MAIN 'I'.
  L_WA_ASS-SG_ADDY SPACE.
  L_WA_ASS-OP_MAIN 'OBJECTKEY1'.
  APPEND L_WA_ASS TO L_WA_RESTRICT-ASS_TAB.


  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
      RESTRICTION L_WA_RESTRICT.
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.




Serkan AKKAVAK
Computer Engineer
SAP Department Deputy Manager
Contact : serkurumsal@yandex.com