Restrict Select options
***********************This is function module to restrict the select-options*******************************
FORM select_options_restrict .
* Define the object to be passed to the RESTRICTION
DATA:
l_restrict TYPE sscr_restrict,
* Auxiliary objects for filling RESTRICT
l_opt_list TYPE sscr_opt_list,
l_ass TYPE sscr_ass.
MOVE 'JUST_EQ' TO l_opt_list-name.
MOVE 'X' TO l_opt_list-options-eq.
APPEND l_opt_list TO l_restrict-opt_list_tab.
MOVE: 'S' TO l_ass-kind,
'S_STEQU' TO l_ass-name,
'I' TO l_ass-sg_main,
'*' TO l_ass-sg_addy,
'JUST_EQ' TO l_ass-op_main.
APPEND l_ass TO l_restrict-ass_tab.
MOVE: 'S' TO l_ass-kind,
'S_STYYY' TO l_ass-name,
'I' TO l_ass-sg_main,
'*' TO l_ass-sg_addy,
'JUST_EQ' TO l_ass-op_main.
APPEND l_ass TO l_restrict-ass_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
* PROGRAM =
restriction = l_restrict
* DB = ' '
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.
* Implement suitable error handling here
ENDIF.
ENDFORM. " SELECT_OPTIONS_RESTRICT
FORM select_options_restrict .
* Define the object to be passed to the RESTRICTION
DATA:
l_restrict TYPE sscr_restrict,
* Auxiliary objects for filling RESTRICT
l_opt_list TYPE sscr_opt_list,
l_ass TYPE sscr_ass.
MOVE 'JUST_EQ' TO l_opt_list-name.
MOVE 'X' TO l_opt_list-options-eq.
APPEND l_opt_list TO l_restrict-opt_list_tab.
MOVE: 'S' TO l_ass-kind,
'S_STEQU' TO l_ass-name,
'I' TO l_ass-sg_main,
'*' TO l_ass-sg_addy,
'JUST_EQ' TO l_ass-op_main.
APPEND l_ass TO l_restrict-ass_tab.
MOVE: 'S' TO l_ass-kind,
'S_STYYY' TO l_ass-name,
'I' TO l_ass-sg_main,
'*' TO l_ass-sg_addy,
'JUST_EQ' TO l_ass-op_main.
APPEND l_ass TO l_restrict-ass_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
* PROGRAM =
restriction = l_restrict
* DB = ' '
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.
* Implement suitable error handling here
ENDIF.
ENDFORM. " SELECT_OPTIONS_RESTRICT
Comments
Post a Comment