Select Option Restrict Value Showing single value at select option
Requirement to display single value in select option for this purpose we have to use below function
Module.
TYPE-POOLS sccr.
DATA restrict TYPE sscr_restrict.
DATA optlist TYPE sscr_opt_list.
DATA ass TYPE sscr_ass.
optlist-name = 'OBJECTKEY1'.
optlist-options-eq = 'X'.
APPEND optlist TO restrict-opt_list_tab.
ass-kind = 'S'.
ass-name = 'S_ERATE'.
ass-sg_main = 'I'.
ass-op_main = 'OBJECTKEY1'.
APPEND ass TO restrict-ass_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
program = sy-cprog
restriction = restrict
db = space
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.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Module.
TYPE-POOLS sccr.
DATA restrict TYPE sscr_restrict.
DATA optlist TYPE sscr_opt_list.
DATA ass TYPE sscr_ass.
optlist-name = 'OBJECTKEY1'.
optlist-options-eq = 'X'.
APPEND optlist TO restrict-opt_list_tab.
ass-kind = 'S'.
ass-name = 'S_ERATE'.
ass-sg_main = 'I'.
ass-op_main = 'OBJECTKEY1'.
APPEND ass TO restrict-ass_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
program = sy-cprog
restriction = restrict
db = space
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.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Comments
Post a Comment