SAP FREE_SELECTIONS_DIALOG Function Module for Dialog for entering dynamic selection conditions









FREE_SELECTIONS_DIALOG is a standard free selections dialog SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Dialog for entering dynamic selection conditions 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 free selections dialog FM, simply by entering the name FREE_SELECTIONS_DIALOG into the relevant SAP transaction such as SE37 or SE38.

Function Group: SSEL
Program Name: SAPLSSEL
Main Program: SAPLSSEL
Appliation area: S
Release date: 26-Feb-1998
Mode(Normal, Remote etc): Normal Function Module
Update:



Function FREE_SELECTIONS_DIALOG 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 'FREE_SELECTIONS_DIALOG'"Dialog for entering dynamic selection conditions
EXPORTING
SELECTION_ID = "The SELID returned by FREE_SELECTIONS_INIT
* PFKEY = "Individual GUI status (status + program).
* ALV = ' ' "Internal use
* TREE_VISIBLE = 'X' "Do you want to display the field selection tree?
* DIAG_TEXT_1 = "Replacement text:'Deleting dynamic selections'
* DIAG_TEXT_2 = "Replacement text:'Changing dynamic selections'
* WARNING_TITLE = "Warning dialob box title
* AS_SUBSCREEN = ' ' "(For internal use only) Integrate Dynamic Selections as Subscreen
* NO_FRAME = "
* TITLE = ' ' "Selection screen title
* FRAME_TEXT = ' ' "Frame text on selection screen
* STATUS = "Status number (see long text)
* AS_WINDOW = ' ' "X: Selection screen as dialog box
* START_ROW = 2 "Dialog box: Initial row
* START_COL = 2 "Dialog box: Initial column
* NO_INTERVALS = ' ' "Thin selection screen (no HIGH field)
* JUST_DISPLAY = ' ' "X: Display Mode

IMPORTING
WHERE_CLAUSES = "Selections in form of WHERE clauses
EXPRESSIONS = "Selections in form of logical expressions
FIELD_RANGES = "Selections in form of RANGES tables
NUMBER_OF_ACTIVE_FIELDS = "Number of fields with selections

TABLES
FIELDS_TAB = "Returns selected fields
* FCODE_TAB = "Internal use
* FIELDS_NOT_SELECTED = "Kind 'F': List of deselected fields.

EXCEPTIONS
INTERNAL_ERROR = 1 NO_ACTION = 2 SELID_NOT_FOUND = 3 ILLEGAL_STATUS = 4
.



IMPORTING Parameters details for FREE_SELECTIONS_DIALOG

SELECTION_ID - The SELID returned by FREE_SELECTIONS_INIT

Data type: RSDYNSEL-SELID
Optional: No
Call by Reference: No ( called with pass by value option)

PFKEY - Individual GUI status (status + program).

Data type: RSDSPFKEY
Optional: Yes
Call by Reference: No ( called with pass by value option)

ALV - Internal use

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TREE_VISIBLE - Do you want to display the field selection tree?

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: Yes

DIAG_TEXT_1 - Replacement text:'Deleting dynamic selections'

Data type: C
Optional: Yes
Call by Reference: Yes

DIAG_TEXT_2 - Replacement text:'Changing dynamic selections'

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

WARNING_TITLE - Warning dialob box title

Data type: C
Optional: Yes
Call by Reference: Yes

AS_SUBSCREEN - (For internal use only) Integrate Dynamic Selections as Subscreen

Data type:
Default: SPACE
Optional: Yes
Call by Reference: Yes

NO_FRAME -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

TITLE - Selection screen title

Data type: SY-TITLE
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

FRAME_TEXT - Frame text on selection screen

Data type: SY-TITLE
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

STATUS - Status number (see long text)

Data type: I
Optional: Yes
Call by Reference: No ( called with pass by value option)

AS_WINDOW - X: Selection screen as dialog box

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_ROW - Dialog box: Initial row

Data type: SY-WINY1
Default: 2
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_COL - Dialog box: Initial column

Data type: SY-WINX1
Default: 2
Optional: Yes
Call by Reference: No ( called with pass by value option)

NO_INTERVALS - Thin selection screen (no HIGH field)

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

JUST_DISPLAY - X: Display Mode

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for FREE_SELECTIONS_DIALOG

WHERE_CLAUSES - Selections in form of WHERE clauses

Data type: RSDS_TWHERE
Optional: No
Call by Reference: No ( called with pass by value option)

EXPRESSIONS - Selections in form of logical expressions

Data type: RSDS_TEXPR
Optional: No
Call by Reference: No ( called with pass by value option)

FIELD_RANGES - Selections in form of RANGES tables

Data type: RSDS_TRANGE
Optional: No
Call by Reference: No ( called with pass by value option)

NUMBER_OF_ACTIVE_FIELDS - Number of fields with selections

Data type: SY-TFILL
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for FREE_SELECTIONS_DIALOG

FIELDS_TAB - Returns selected fields

Data type: RSDSFIELDS
Optional: No
Call by Reference: No ( called with pass by value option)

FCODE_TAB - Internal use

Data type: RSDSFCODE
Optional: Yes
Call by Reference: No ( called with pass by value option)

FIELDS_NOT_SELECTED - Kind 'F': List of deselected fields.

Data type: RSDSFIELDS
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

INTERNAL_ERROR - Internal error

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_ACTION - Canceled by user

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

SELID_NOT_FOUND - Transfer non-existent selection ID

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ILLEGAL_STATUS - Invalid status number

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for FREE_SELECTIONS_DIALOG 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:
lt_fields_tab  TYPE STANDARD TABLE OF RSDSFIELDS, "   
lv_selection_id  TYPE RSDYNSEL-SELID, "   
lv_where_clauses  TYPE RSDS_TWHERE, "   
lv_internal_error  TYPE RSDS_TWHERE, "   
lv_pfkey  TYPE RSDSPFKEY, "   
lv_alv  TYPE C, "   SPACE
lv_tree_visible  TYPE C, "   'X'
lv_diag_text_1  TYPE C, "   
lv_diag_text_2  TYPE C, "   
lv_warning_title  TYPE C, "   
lv_as_subscreen  TYPE C, "   SPACE
lv_no_frame  TYPE C, "   
lv_title  TYPE SY-TITLE, "   SPACE
lt_fcode_tab  TYPE STANDARD TABLE OF RSDSFCODE, "   
lv_no_action  TYPE RSDSFCODE, "   
lv_expressions  TYPE RSDS_TEXPR, "   
lv_frame_text  TYPE SY-TITLE, "   SPACE
lv_field_ranges  TYPE RSDS_TRANGE, "   
lv_selid_not_found  TYPE RSDS_TRANGE, "   
lt_fields_not_selected  TYPE STANDARD TABLE OF RSDSFIELDS, "   
lv_status  TYPE I, "   
lv_illegal_status  TYPE I, "   
lv_number_of_active_fields  TYPE SY-TFILL, "   
lv_as_window  TYPE C, "   SPACE
lv_start_row  TYPE SY-WINY1, "   2
lv_start_col  TYPE SY-WINX1, "   2
lv_no_intervals  TYPE C, "   SPACE
lv_just_display  TYPE C. "   SPACE

  CALL FUNCTION 'FREE_SELECTIONS_DIALOG'  "Dialog for entering dynamic selection conditions
    EXPORTING
         SELECTION_ID = lv_selection_id
         PFKEY = lv_pfkey
         ALV = lv_alv
         TREE_VISIBLE = lv_tree_visible
         DIAG_TEXT_1 = lv_diag_text_1
         DIAG_TEXT_2 = lv_diag_text_2
         WARNING_TITLE = lv_warning_title
         AS_SUBSCREEN = lv_as_subscreen
         NO_FRAME = lv_no_frame
         TITLE = lv_title
         FRAME_TEXT = lv_frame_text
         STATUS = lv_status
         AS_WINDOW = lv_as_window
         START_ROW = lv_start_row
         START_COL = lv_start_col
         NO_INTERVALS = lv_no_intervals
         JUST_DISPLAY = lv_just_display
    IMPORTING
         WHERE_CLAUSES = lv_where_clauses
         EXPRESSIONS = lv_expressions
         FIELD_RANGES = lv_field_ranges
         NUMBER_OF_ACTIVE_FIELDS = lv_number_of_active_fields
    TABLES
         FIELDS_TAB = lt_fields_tab
         FCODE_TAB = lt_fcode_tab
         FIELDS_NOT_SELECTED = lt_fields_not_selected
    EXCEPTIONS
        INTERNAL_ERROR = 1
        NO_ACTION = 2
        SELID_NOT_FOUND = 3
        ILLEGAL_STATUS = 4
. " FREE_SELECTIONS_DIALOG




ABAP code using 7.40 inline data declarations to call FM FREE_SELECTIONS_DIALOG

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 SELID FROM RSDYNSEL INTO @DATA(ld_selection_id).
 
 
 
 
DATA(ld_alv) = ' '.
 
DATA(ld_tree_visible) = 'X'.
 
 
 
 
DATA(ld_as_subscreen) = ' '.
 
 
"SELECT single TITLE FROM SY INTO @DATA(ld_title).
DATA(ld_title) = ' '.
 
 
 
 
"SELECT single TITLE FROM SY INTO @DATA(ld_frame_text).
DATA(ld_frame_text) = ' '.
 
 
 
 
 
 
"SELECT single TFILL FROM SY INTO @DATA(ld_number_of_active_fields).
 
DATA(ld_as_window) = ' '.
 
"SELECT single WINY1 FROM SY INTO @DATA(ld_start_row).
DATA(ld_start_row) = 2.
 
"SELECT single WINX1 FROM SY INTO @DATA(ld_start_col).
DATA(ld_start_col) = 2.
 
DATA(ld_no_intervals) = ' '.
 
DATA(ld_just_display) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!