SAP SELECT_OPTIONS_RESTRICT Function Module for Make use of SELECT-OPTIONS easier on the selection screen
SELECT_OPTIONS_RESTRICT is a standard select options restrict SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Make use of SELECT-OPTIONS easier on the selection screen processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for select options restrict FM, simply by entering the name SELECT_OPTIONS_RESTRICT into the relevant SAP transaction such as SE37 or SE38.
Function Group: SLDB
Program Name: SAPLSLDB
Main Program: SAPLSLDB
Appliation area: S
Release date: 26-Feb-1998
Mode(Normal, Remote etc): Normal Function Module
Update:
Function SELECT_OPTIONS_RESTRICT pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'"Make use of SELECT-OPTIONS easier on the selection screen.
EXPORTING
* PROGRAM = "Program name (default SY-CPROG or SY-LDBPG)
RESTRICTION = "Description of restrictions
* DB = ' ' "X: Call using logical database
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
IMPORTING Parameters details for SELECT_OPTIONS_RESTRICT
PROGRAM - Program name (default SY-CPROG or SY-LDBPG)
Data type: SY-REPIDOptional: Yes
Call by Reference: No ( called with pass by value option)
RESTRICTION - Description of restrictions
Data type: SSCR_RESTRICTOptional: No
Call by Reference: Yes
DB - X: Call using logical database
Data type: RSSCR-DBDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
TOO_LATE - Call is too late
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
REPEATED - Multiple call using LDB or report
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SELOPT_WITHOUT_OPTIONS - One of the select-options contains no valid options
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SELOPT_WITHOUT_SIGNS - One of the select-options does not have a valid sign
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_SIGN - Invalid sign
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EMPTY_OPTION_LIST - One of the options lists is empty
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_KIND - One line has a KIND value unequal to A, B, or S
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
REPEATED_KIND_A - More than one line has KIND = 'A'
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SELECT_OPTIONS_RESTRICT Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lv_program | TYPE SY-REPID, " | |||
lv_too_late | TYPE SY, " | |||
lv_repeated | TYPE SY, " | |||
lv_restriction | TYPE SSCR_RESTRICT, " | |||
lv_db | TYPE RSSCR-DB, " SPACE | |||
lv_selopt_without_options | TYPE RSSCR, " | |||
lv_selopt_without_signs | TYPE RSSCR, " | |||
lv_invalid_sign | TYPE RSSCR, " | |||
lv_empty_option_list | TYPE RSSCR, " | |||
lv_invalid_kind | TYPE RSSCR, " | |||
lv_repeated_kind_a | TYPE RSSCR. " |
  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT' "Make use of SELECT-OPTIONS easier on the selection screen |
EXPORTING | ||
PROGRAM | = lv_program | |
RESTRICTION | = lv_restriction | |
DB | = lv_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 | ||
. " SELECT_OPTIONS_RESTRICT |
ABAP code using 7.40 inline data declarations to call FM SELECT_OPTIONS_RESTRICT
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8."SELECT single REPID FROM SY INTO @DATA(ld_program). | ||||
"SELECT single DB FROM RSSCR INTO @DATA(ld_db). | ||||
DATA(ld_db) | = ' '. | |||
Search for further information about these or an SAP related objects