Sometime it is required to restrict range input for a select option. SAP provides an extension which is generally used for this is NO INTERVALS.
**********************************************************************
* TYPE-POOLS:
**********************************************************************
TYPE-POOLS: sscr.
*----------------------------------------------------------------------*
* T A B L E S *
*----------------------------------------------------------------------*
TABLES: mara.
*----------------------------------------------------------------------*
* S E L E C T I O N S C R E E N *
*----------------------------------------------------------------------*
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME.
SELECT-OPTIONS: mat FOR mara-matnr NO INTERVALS.
SELECT-OPTIONS: mtype FOR mara-mtart NO INTERVALS.
SELECTION-SCREEN: END OF BLOCK b2.
*---------------------------------------------------------------------*
* Initialization Event
*---------------------------------------------------------------------*
INITIALIZATION.
CONSTANTS: lc_opt_list TYPE rsrest_opl VALUE 'OPT_LIST',
lc_s TYPE rsscr_kind VALUE 'S',
lc_mat TYPE blockname VALUE 'MAT',
lc_inc TYPE c VALUE 'I'.
DATA: lw_opt_list TYPE sscr_opt_list,
lw_restrict TYPE sscr_restrict,
lw_ass TYPE sscr_ass.
lw_opt_list-name = lc_opt_list.
lw_opt_list-options-bt = space.
lw_opt_list-options-eq = 'X'.
APPEND lw_opt_list TO lw_restrict-opt_list_tab.
lw_ass-kind = lc_s.
lw_ass-name = lc_mat.
lw_ass-sg_main = lc_inc.
lw_ass-op_main = lc_opt_list.
APPEND lw_ass TO lw_restrict-ass_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = lw_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.
With NO INTERVALS command. After pressing multiple selection tab you can enter range value.
After restricting with the function module you can not enter range value now.
There are other option available in this function module. Explore and enjoy :)