SAP REUSE_ALV_GRID_DISPLAY Function Module for Output of a simple list (single-line)
REUSE_ALV_GRID_DISPLAY is a standard reuse alv grid display SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Output of a simple list (single-line) 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 reuse alv grid display FM, simply by entering the name REUSE_ALV_GRID_DISPLAY into the relevant SAP transaction such as SE37 or SE38.
Function Group: SLVC_FULLSCREEN
Program Name: SAPLSLVC_FULLSCREEN
Main Program: SAPLSLVC_FULLSCREEN
Appliation area:
Release date: 16-Jul-1999
Mode(Normal, Remote etc): Normal Function Module
Update:
Function REUSE_ALV_GRID_DISPLAY 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 'REUSE_ALV_GRID_DISPLAY'"Output of a simple list (single-line).
EXPORTING
* I_INTERFACE_CHECK = ' ' "Interface consistency check log output
* I_STRUCTURE_NAME = "Internal output table structure name
* I_BACKGROUND_ID = ' ' "Object ID of wallpaper
* I_GRID_TITLE = "Control title
* I_GRID_SETTINGS = "Grid settings
* IS_LAYOUT = "List layout specifications
* IT_FIELDCAT = "Field catalog with field descriptions
* IT_EXCLUDING = "Table of inactive function codes
* IT_SPECIAL_GROUPS = "Grouping fields for column selection
* IT_SORT = "Sort criteria for first list display
* IT_FILTER = "Filter criteria for first list output
* I_BYPASSING_BUFFER = ' ' "Ignore all buffers
* IS_SEL_HIDE = "Selection information modification
* I_DEFAULT = 'X' "Initial variant active/inactive logic
* I_SAVE = ' ' "Variants can be saved
* IS_VARIANT = "Variant information
* IT_EVENTS = "Table of events to perform
* IT_EVENT_EXIT = "Standard fcode exit requests table
* IS_PRINT = "Print information
* IS_REPREP_ID = "Initialization key for Re/Re interface
* I_SCREEN_START_COLUMN = 0 "Coordinates for list in dialog box
* I_SCREEN_START_LINE = 0 "Coordinates for list in dialog box
* I_BUFFER_ACTIVE = ' ' "Buffering active
* I_SCREEN_END_COLUMN = 0 "Coordinates for list in dialog box
* I_SCREEN_END_LINE = 0 "Coordinates for list in dialog box
* I_HTML_HEIGHT_TOP = 0 "HTML_TOP_OF_PAGE Height
* I_HTML_HEIGHT_END = 0 "HTML_END_OF_PAGE Height
* IT_ALV_GRAPHICS = "Parameter for ALV graphic
* IT_HYPERLINK = "Hyperlinks
* IT_ADD_FIELDCAT = "Additional Field Catalog Options
* IT_EXCEPT_QINFO = "
* IR_SALV_FULLSCREEN_ADAPTER = "Adapter Fullscreen -> Table
* I_CALLBACK_PROGRAM = ' ' "Name of the calling program
* I_CALLBACK_PF_STATUS_SET = ' ' "Set EXIT routine to status
* I_CALLBACK_USER_COMMAND = ' ' "EXIT routine for command handling
* I_CALLBACK_TOP_OF_PAGE = ' ' "EXIT routine for handling TOP-OF-PAGE
* I_CALLBACK_HTML_TOP_OF_PAGE = ' ' "EXIT routine for HTML TOP-OF-PAGE
* I_CALLBACK_HTML_END_OF_LIST = ' ' "EXIT routine for HTML END-OF-LIST
IMPORTING
E_EXIT_CAUSED_BY_CALLER = "Delete list in CALLBACK_USER_COMMAND
ES_EXIT_CAUSED_BY_USER = "How the user left the list
TABLES
T_OUTTAB = "Table with data to be displayed
EXCEPTIONS
PROGRAM_ERROR = 1
IMPORTING Parameters details for REUSE_ALV_GRID_DISPLAY
I_INTERFACE_CHECK - Interface consistency check log output
Data type:Default: SPACE
Optional: Yes
Call by Reference: Yes
I_STRUCTURE_NAME - Internal output table structure name
Data type: DD02L-TABNAMEOptional: Yes
Call by Reference: Yes
I_BACKGROUND_ID - Object ID of wallpaper
Data type: SDYDO_KEYDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_GRID_TITLE - Control title
Data type: LVC_TITLEOptional: Yes
Call by Reference: Yes
I_GRID_SETTINGS - Grid settings
Data type: LVC_S_GLAYOptional: Yes
Call by Reference: Yes
IS_LAYOUT - List layout specifications
Data type: SLIS_LAYOUT_ALVOptional: Yes
Call by Reference: Yes
IT_FIELDCAT - Field catalog with field descriptions
Data type: SLIS_T_FIELDCAT_ALVOptional: Yes
Call by Reference: Yes
IT_EXCLUDING - Table of inactive function codes
Data type: SLIS_T_EXTABOptional: Yes
Call by Reference: Yes
IT_SPECIAL_GROUPS - Grouping fields for column selection
Data type: SLIS_T_SP_GROUP_ALVOptional: Yes
Call by Reference: Yes
IT_SORT - Sort criteria for first list display
Data type: SLIS_T_SORTINFO_ALVOptional: Yes
Call by Reference: Yes
IT_FILTER - Filter criteria for first list output
Data type: SLIS_T_FILTER_ALVOptional: Yes
Call by Reference: Yes
I_BYPASSING_BUFFER - Ignore all buffers
Data type: CHAR01Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IS_SEL_HIDE - Selection information modification
Data type: SLIS_SEL_HIDE_ALVOptional: Yes
Call by Reference: Yes
I_DEFAULT - Initial variant active/inactive logic
Data type:Default: 'X'
Optional: Yes
Call by Reference: Yes
I_SAVE - Variants can be saved
Data type:Default: SPACE
Optional: Yes
Call by Reference: Yes
IS_VARIANT - Variant information
Data type: DISVARIANTOptional: Yes
Call by Reference: Yes
IT_EVENTS - Table of events to perform
Data type: SLIS_T_EVENTOptional: Yes
Call by Reference: Yes
IT_EVENT_EXIT - Standard fcode exit requests table
Data type: SLIS_T_EVENT_EXITOptional: Yes
Call by Reference: Yes
IS_PRINT - Print information
Data type: SLIS_PRINT_ALVOptional: Yes
Call by Reference: Yes
IS_REPREP_ID - Initialization key for Re/Re interface
Data type: SLIS_REPREP_IDOptional: Yes
Call by Reference: Yes
I_SCREEN_START_COLUMN - Coordinates for list in dialog box
Data type:Optional: Yes
Call by Reference: Yes
I_SCREEN_START_LINE - Coordinates for list in dialog box
Data type:Optional: Yes
Call by Reference: Yes
I_BUFFER_ACTIVE - Buffering active
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SCREEN_END_COLUMN - Coordinates for list in dialog box
Data type:Optional: Yes
Call by Reference: Yes
I_SCREEN_END_LINE - Coordinates for list in dialog box
Data type:Optional: Yes
Call by Reference: Yes
I_HTML_HEIGHT_TOP - HTML_TOP_OF_PAGE Height
Data type: IOptional: Yes
Call by Reference: Yes
I_HTML_HEIGHT_END - HTML_END_OF_PAGE Height
Data type: IOptional: Yes
Call by Reference: Yes
IT_ALV_GRAPHICS - Parameter for ALV graphic
Data type: DTC_T_TCOptional: Yes
Call by Reference: Yes
IT_HYPERLINK - Hyperlinks
Data type: LVC_T_HYPEOptional: Yes
Call by Reference: Yes
IT_ADD_FIELDCAT - Additional Field Catalog Options
Data type: SLIS_T_ADD_FIELDCATOptional: Yes
Call by Reference: Yes
IT_EXCEPT_QINFO -
Data type: SLIS_T_QINFO_ALVOptional: Yes
Call by Reference: Yes
IR_SALV_FULLSCREEN_ADAPTER - Adapter Fullscreen -> Table
Data type: CL_SALV_FULLSCREEN_ADAPTEROptional: Yes
Call by Reference: Yes
I_CALLBACK_PROGRAM - Name of the calling program
Data type: SY-REPIDDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_CALLBACK_PF_STATUS_SET - Set EXIT routine to status
Data type: SLIS_FORMNAMEDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_CALLBACK_USER_COMMAND - EXIT routine for command handling
Data type: SLIS_FORMNAMEDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_CALLBACK_TOP_OF_PAGE - EXIT routine for handling TOP-OF-PAGE
Data type: SLIS_FORMNAMEDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_CALLBACK_HTML_TOP_OF_PAGE - EXIT routine for HTML TOP-OF-PAGE
Data type: SLIS_FORMNAMEDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_CALLBACK_HTML_END_OF_LIST - EXIT routine for HTML END-OF-LIST
Data type: SLIS_FORMNAMEDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for REUSE_ALV_GRID_DISPLAY
E_EXIT_CAUSED_BY_CALLER - Delete list in CALLBACK_USER_COMMAND
Data type:Optional: No
Call by Reference: Yes
ES_EXIT_CAUSED_BY_USER - How the user left the list
Data type: SLIS_EXIT_BY_USEROptional: No
Call by Reference: Yes
TABLES Parameters details for REUSE_ALV_GRID_DISPLAY
T_OUTTAB - Table with data to be displayed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
PROGRAM_ERROR - Program errors
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for REUSE_ALV_GRID_DISPLAY 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_t_outtab | TYPE STANDARD TABLE OF STRING, " | |||
lv_program_error | TYPE STRING, " | |||
lv_i_interface_check | TYPE STRING, " SPACE | |||
lv_e_exit_caused_by_caller | TYPE STRING, " | |||
lv_i_structure_name | TYPE DD02L-TABNAME, " | |||
lv_i_background_id | TYPE SDYDO_KEY, " SPACE | |||
lv_i_grid_title | TYPE LVC_TITLE, " | |||
lv_i_grid_settings | TYPE LVC_S_GLAY, " | |||
lv_is_layout | TYPE SLIS_LAYOUT_ALV, " | |||
lv_it_fieldcat | TYPE SLIS_T_FIELDCAT_ALV, " | |||
lv_it_excluding | TYPE SLIS_T_EXTAB, " | |||
lv_it_special_groups | TYPE SLIS_T_SP_GROUP_ALV, " | |||
lv_it_sort | TYPE SLIS_T_SORTINFO_ALV, " | |||
lv_it_filter | TYPE SLIS_T_FILTER_ALV, " | |||
lv_i_bypassing_buffer | TYPE CHAR01, " SPACE | |||
lv_es_exit_caused_by_user | TYPE SLIS_EXIT_BY_USER, " | |||
lv_is_sel_hide | TYPE SLIS_SEL_HIDE_ALV, " | |||
lv_i_default | TYPE SLIS_SEL_HIDE_ALV, " 'X' | |||
lv_i_save | TYPE SLIS_SEL_HIDE_ALV, " SPACE | |||
lv_is_variant | TYPE DISVARIANT, " | |||
lv_it_events | TYPE SLIS_T_EVENT, " | |||
lv_it_event_exit | TYPE SLIS_T_EVENT_EXIT, " | |||
lv_is_print | TYPE SLIS_PRINT_ALV, " | |||
lv_is_reprep_id | TYPE SLIS_REPREP_ID, " | |||
lv_i_screen_start_column | TYPE SLIS_REPREP_ID, " 0 | |||
lv_i_screen_start_line | TYPE SLIS_REPREP_ID, " 0 | |||
lv_i_buffer_active | TYPE SLIS_REPREP_ID, " SPACE | |||
lv_i_screen_end_column | TYPE SLIS_REPREP_ID, " 0 | |||
lv_i_screen_end_line | TYPE SLIS_REPREP_ID, " 0 | |||
lv_i_html_height_top | TYPE I, " 0 | |||
lv_i_html_height_end | TYPE I, " 0 | |||
lv_it_alv_graphics | TYPE DTC_T_TC, " | |||
lv_it_hyperlink | TYPE LVC_T_HYPE, " | |||
lv_it_add_fieldcat | TYPE SLIS_T_ADD_FIELDCAT, " | |||
lv_it_except_qinfo | TYPE SLIS_T_QINFO_ALV, " | |||
lv_ir_salv_fullscreen_adapter | TYPE CL_SALV_FULLSCREEN_ADAPTER, " | |||
lv_i_callback_program | TYPE SY-REPID, " SPACE | |||
lv_i_callback_pf_status_set | TYPE SLIS_FORMNAME, " SPACE | |||
lv_i_callback_user_command | TYPE SLIS_FORMNAME, " SPACE | |||
lv_i_callback_top_of_page | TYPE SLIS_FORMNAME, " SPACE | |||
lv_i_callback_html_top_of_page | TYPE SLIS_FORMNAME, " SPACE | |||
lv_i_callback_html_end_of_list | TYPE SLIS_FORMNAME. " SPACE |
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' "Output of a simple list (single-line) |
EXPORTING | ||
I_INTERFACE_CHECK | = lv_i_interface_check | |
I_STRUCTURE_NAME | = lv_i_structure_name | |
I_BACKGROUND_ID | = lv_i_background_id | |
I_GRID_TITLE | = lv_i_grid_title | |
I_GRID_SETTINGS | = lv_i_grid_settings | |
IS_LAYOUT | = lv_is_layout | |
IT_FIELDCAT | = lv_it_fieldcat | |
IT_EXCLUDING | = lv_it_excluding | |
IT_SPECIAL_GROUPS | = lv_it_special_groups | |
IT_SORT | = lv_it_sort | |
IT_FILTER | = lv_it_filter | |
I_BYPASSING_BUFFER | = lv_i_bypassing_buffer | |
IS_SEL_HIDE | = lv_is_sel_hide | |
I_DEFAULT | = lv_i_default | |
I_SAVE | = lv_i_save | |
IS_VARIANT | = lv_is_variant | |
IT_EVENTS | = lv_it_events | |
IT_EVENT_EXIT | = lv_it_event_exit | |
IS_PRINT | = lv_is_print | |
IS_REPREP_ID | = lv_is_reprep_id | |
I_SCREEN_START_COLUMN | = lv_i_screen_start_column | |
I_SCREEN_START_LINE | = lv_i_screen_start_line | |
I_BUFFER_ACTIVE | = lv_i_buffer_active | |
I_SCREEN_END_COLUMN | = lv_i_screen_end_column | |
I_SCREEN_END_LINE | = lv_i_screen_end_line | |
I_HTML_HEIGHT_TOP | = lv_i_html_height_top | |
I_HTML_HEIGHT_END | = lv_i_html_height_end | |
IT_ALV_GRAPHICS | = lv_it_alv_graphics | |
IT_HYPERLINK | = lv_it_hyperlink | |
IT_ADD_FIELDCAT | = lv_it_add_fieldcat | |
IT_EXCEPT_QINFO | = lv_it_except_qinfo | |
IR_SALV_FULLSCREEN_ADAPTER | = lv_ir_salv_fullscreen_adapter | |
I_CALLBACK_PROGRAM | = lv_i_callback_program | |
I_CALLBACK_PF_STATUS_SET | = lv_i_callback_pf_status_set | |
I_CALLBACK_USER_COMMAND | = lv_i_callback_user_command | |
I_CALLBACK_TOP_OF_PAGE | = lv_i_callback_top_of_page | |
I_CALLBACK_HTML_TOP_OF_PAGE | = lv_i_callback_html_top_of_page | |
I_CALLBACK_HTML_END_OF_LIST | = lv_i_callback_html_end_of_list | |
IMPORTING | ||
E_EXIT_CAUSED_BY_CALLER | = lv_e_exit_caused_by_caller | |
ES_EXIT_CAUSED_BY_USER | = lv_es_exit_caused_by_user | |
TABLES | ||
T_OUTTAB | = lt_t_outtab | |
EXCEPTIONS | ||
PROGRAM_ERROR = 1 | ||
. " REUSE_ALV_GRID_DISPLAY |
ABAP code using 7.40 inline data declarations to call FM REUSE_ALV_GRID_DISPLAY
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_i_interface_check) | = ' '. | |||
"SELECT single TABNAME FROM DD02L INTO @DATA(ld_i_structure_name). | ||||
DATA(ld_i_background_id) | = ' '. | |||
DATA(ld_i_bypassing_buffer) | = ' '. | |||
DATA(ld_i_default) | = 'X'. | |||
DATA(ld_i_save) | = ' '. | |||
DATA(ld_i_buffer_active) | = ' '. | |||
"SELECT single REPID FROM SY INTO @DATA(ld_i_callback_program). | ||||
DATA(ld_i_callback_program) | = ' '. | |||
DATA(ld_i_callback_pf_status_set) | = ' '. | |||
DATA(ld_i_callback_user_command) | = ' '. | |||
DATA(ld_i_callback_top_of_page) | = ' '. | |||
DATA(ld_i_callback_html_top_of_page) | = ' '. | |||
DATA(ld_i_callback_html_end_of_list) | = ' '. | |||
Search for further information about these or an SAP related objects