SAP G_DISPLAY_SELECTION_DYNPRO Function Module for Display of Object List with Optional Selection Option
G_DISPLAY_SELECTION_DYNPRO is a standard g display selection dynpro SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Display of Object List with Optional Selection Option 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 g display selection dynpro FM, simply by entering the name G_DISPLAY_SELECTION_DYNPRO into the relevant SAP transaction such as SE37 or SE38.
Function Group: GSEL
Program Name: SAPLGSEL
Main Program: SAPLGSEL
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function G_DISPLAY_SELECTION_DYNPRO 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 'G_DISPLAY_SELECTION_DYNPRO'"Display of Object List with Optional Selection Option.
EXPORTING
* ALLOW_PRINT = ' ' "X = Printing possible
* SHOW_ALSO_1 = ' ' "Also Display List with 1 Entry
* START_COLUMN = 0 "Column in Which Window Starts
* START_ROW = 3 "Line in Which Window Starts
* WIDTH_OF_TITLES = ' ' "Take Title Length into Account for Output Width
* WITHOUT_SELECTION = ' ' "Without Selection Option (X=Without)
* MULTIPLE_SELECTION = ' ' "
* ALLOW_SORT = 'X' "
DYNP_TITLE = "Screen title
* EXTENDED_DISPLAY = ' ' "X = Detail display possible
* FIRST_INDEX = 1 "Index of lines that are shown uppermost
* KEY_COLUMNS = 0 "Number of Columns Belonging to Key Fields
* NUMBER_OF_ROWS = 8 "Number of Lines in Popup
* SEL_DEFAULT = 0 "Index of Proposed Line
* SEL_TITLE1 = ' ' "First header line of the list
* SEL_TITLE2 = ' ' "Second header line of the list
IMPORTING
FIRST_INDEX = "Index of lines that are shown uppermost
SEL_INDEX = "Index for Selected Line
EXT_DISPLAY_SELECTED = "= 'X', if detail display requested
TABLES
SEL_TABLE = "Transfer table
* SEL_LINES = "
EXCEPTIONS
NO_LINES = 1 NO_LINE_PICKED = 2
IMPORTING Parameters details for G_DISPLAY_SELECTION_DYNPRO
ALLOW_PRINT - X = Printing possible
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SHOW_ALSO_1 - Also Display List with 1 Entry
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
START_COLUMN - Column in Which Window Starts
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
START_ROW - Line in Which Window Starts
Data type:Default: 3
Optional: Yes
Call by Reference: No ( called with pass by value option)
WIDTH_OF_TITLES - Take Title Length into Account for Output Width
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WITHOUT_SELECTION - Without Selection Option (X=Without)
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
MULTIPLE_SELECTION -
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
ALLOW_SORT -
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DYNP_TITLE - Screen title
Data type: RGSEL-DYNP_TITLEOptional: No
Call by Reference: No ( called with pass by value option)
EXTENDED_DISPLAY - X = Detail display possible
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIRST_INDEX - Index of lines that are shown uppermost
Data type: SY-TABIXDefault: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
KEY_COLUMNS - Number of Columns Belonging to Key Fields
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
NUMBER_OF_ROWS - Number of Lines in Popup
Data type: SY-TABIXDefault: 8
Optional: Yes
Call by Reference: No ( called with pass by value option)
SEL_DEFAULT - Index of Proposed Line
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
SEL_TITLE1 - First header line of the list
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SEL_TITLE2 - Second header line of the list
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for G_DISPLAY_SELECTION_DYNPRO
FIRST_INDEX - Index of lines that are shown uppermost
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
SEL_INDEX - Index for Selected Line
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
EXT_DISPLAY_SELECTED - = 'X', if detail display requested
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for G_DISPLAY_SELECTION_DYNPRO
SEL_TABLE - Transfer table
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SEL_LINES -
Data type: RGSEL_LINEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_LINES - Do not transfer line
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_LINE_PICKED - No line selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for G_DISPLAY_SELECTION_DYNPRO 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_no_lines | TYPE STRING, " | |||
| lt_sel_table | TYPE STANDARD TABLE OF STRING, " | |||
| lv_allow_print | TYPE STRING, " ' ' | |||
| lv_first_index | TYPE SY-TABIX, " | |||
| lv_show_also_1 | TYPE SY, " ' ' | |||
| lv_start_column | TYPE SY, " 0 | |||
| lv_start_row | TYPE SY, " 3 | |||
| lv_width_of_titles | TYPE SY, " ' ' | |||
| lv_without_selection | TYPE SY, " ' ' | |||
| lv_multiple_selection | TYPE SY, " ' ' | |||
| lv_allow_sort | TYPE SY, " 'X' | |||
| lv_sel_index | TYPE SY-TABIX, " | |||
| lt_sel_lines | TYPE STANDARD TABLE OF RGSEL_LINE, " | |||
| lv_dynp_title | TYPE RGSEL-DYNP_TITLE, " | |||
| lv_no_line_picked | TYPE RGSEL, " | |||
| lv_extended_display | TYPE RGSEL, " ' ' | |||
| lv_ext_display_selected | TYPE RGSEL, " | |||
| lv_first_index | TYPE SY-TABIX, " 1 | |||
| lv_key_columns | TYPE SY, " 0 | |||
| lv_number_of_rows | TYPE SY-TABIX, " 8 | |||
| lv_sel_default | TYPE SY, " 0 | |||
| lv_sel_title1 | TYPE SY, " ' ' | |||
| lv_sel_title2 | TYPE SY. " ' ' |
|   CALL FUNCTION 'G_DISPLAY_SELECTION_DYNPRO' "Display of Object List with Optional Selection Option |
| EXPORTING | ||
| ALLOW_PRINT | = lv_allow_print | |
| SHOW_ALSO_1 | = lv_show_also_1 | |
| START_COLUMN | = lv_start_column | |
| START_ROW | = lv_start_row | |
| WIDTH_OF_TITLES | = lv_width_of_titles | |
| WITHOUT_SELECTION | = lv_without_selection | |
| MULTIPLE_SELECTION | = lv_multiple_selection | |
| ALLOW_SORT | = lv_allow_sort | |
| DYNP_TITLE | = lv_dynp_title | |
| EXTENDED_DISPLAY | = lv_extended_display | |
| FIRST_INDEX | = lv_first_index | |
| KEY_COLUMNS | = lv_key_columns | |
| NUMBER_OF_ROWS | = lv_number_of_rows | |
| SEL_DEFAULT | = lv_sel_default | |
| SEL_TITLE1 | = lv_sel_title1 | |
| SEL_TITLE2 | = lv_sel_title2 | |
| IMPORTING | ||
| FIRST_INDEX | = lv_first_index | |
| SEL_INDEX | = lv_sel_index | |
| EXT_DISPLAY_SELECTED | = lv_ext_display_selected | |
| TABLES | ||
| SEL_TABLE | = lt_sel_table | |
| SEL_LINES | = lt_sel_lines | |
| EXCEPTIONS | ||
| NO_LINES = 1 | ||
| NO_LINE_PICKED = 2 | ||
| . " G_DISPLAY_SELECTION_DYNPRO | ||
ABAP code using 7.40 inline data declarations to call FM G_DISPLAY_SELECTION_DYNPRO
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.| DATA(ld_allow_print) | = ' '. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_first_index). | ||||
| DATA(ld_show_also_1) | = ' '. | |||
| DATA(ld_start_row) | = 3. | |||
| DATA(ld_width_of_titles) | = ' '. | |||
| DATA(ld_without_selection) | = ' '. | |||
| DATA(ld_multiple_selection) | = ' '. | |||
| DATA(ld_allow_sort) | = 'X'. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_sel_index). | ||||
| "SELECT single DYNP_TITLE FROM RGSEL INTO @DATA(ld_dynp_title). | ||||
| DATA(ld_extended_display) | = ' '. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_first_index). | ||||
| DATA(ld_first_index) | = 1. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_number_of_rows). | ||||
| DATA(ld_number_of_rows) | = 8. | |||
| DATA(ld_sel_title1) | = ' '. | |||
| DATA(ld_sel_title2) | = ' '. | |||
Search for further information about these or an SAP related objects