SAP MESSAGES_SHOW Function Module for Display collected messages and associated long texts









MESSAGES_SHOW is a standard messages show 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 collected messages and associated long texts 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 messages show FM, simply by entering the name MESSAGES_SHOW into the relevant SAP transaction such as SE37 or SE38.

Function Group: SMSG
Program Name: SAPLSMSG
Main Program: SAPLSMSG
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function MESSAGES_SHOW 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 'MESSAGES_SHOW'"Display collected messages and associated long texts
EXPORTING
* CORRECTIONS_OPTION = ' ' "If warnings occur: Corrections possible
* SHOW_LINNO = 'X' "Also show line numbers
* SHOW_LINNO_TEXT = ' ' "Column header for row
* SHOW_LINNO_TEXT_LEN = '3' "Column width for row in display
* I_USE_GRID = ' ' "Use ALV Grid for Display; Otherwise Classic ALV
* I_AMODAL_WINDOW = ' ' "Amodal Display (X=ja)
* CORRECTIONS_FUNC_TEXT = ' ' "Text for Function Key 'corrections_wanted'
* MSG_SELECT_FUNC = ' ' "Message return possible
* MSG_SELECT_FUNC_TEXT = ' ' "Text for Function Key 'msg_selection_option'
* LINE_FROM = ' ' "Only show messages with longer reference line
* LINE_TO = ' ' "Only show messages with shorter reference line
* OBJECT = ' ' "Object for title in message dialog box
* SEND_IF_ONE = ' ' "Message sent directly if number = 1
* BATCH_LIST_TYPE = 'J' "J = job log / L = in spool list / B = both

IMPORTING
CORRECTIONS_WANTED = "If warnings occur: Corrections required
MSG_SELECTED = "Message Collector
E_EXIT_COMMAND = "Information: Dialog closed by Enter/Cancel/Back

EXCEPTIONS
INCONSISTENT_RANGE = 1 NO_MESSAGES = 2
.



IMPORTING Parameters details for MESSAGES_SHOW

CORRECTIONS_OPTION - If warnings occur: Corrections possible

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

SHOW_LINNO - Also show line numbers

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

SHOW_LINNO_TEXT - Column header for row

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

SHOW_LINNO_TEXT_LEN - Column width for row in display

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

I_USE_GRID - Use ALV Grid for Display; Otherwise Classic ALV

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

I_AMODAL_WINDOW - Amodal Display (X=ja)

Data type: BOOLE-BOOLE
Default: ' '
Optional: Yes
Call by Reference: Yes

CORRECTIONS_FUNC_TEXT - Text for Function Key 'corrections_wanted'

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

MSG_SELECT_FUNC - Message return possible

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

MSG_SELECT_FUNC_TEXT - Text for Function Key 'msg_selection_option'

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

LINE_FROM - Only show messages with longer reference line

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

LINE_TO - Only show messages with shorter reference line

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

OBJECT - Object for title in message dialog box

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

SEND_IF_ONE - Message sent directly if number = 1

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

BATCH_LIST_TYPE - J = job log / L = in spool list / B = both

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

EXPORTING Parameters details for MESSAGES_SHOW

CORRECTIONS_WANTED - If warnings occur: Corrections required

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

MSG_SELECTED - Message Collector

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

E_EXIT_COMMAND - Information: Dialog closed by Enter/Cancel/Back

Data type: BAL_S_EXCM
Optional: No
Call by Reference: Yes

EXCEPTIONS details

INCONSISTENT_RANGE - LINE_TO is shorter than LINE_FROM

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

NO_MESSAGES - No messages in required interval

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

Copy and paste ABAP code example for MESSAGES_SHOW 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_corrections_option  TYPE C, "   SPACE
lv_corrections_wanted  TYPE C, "   
lv_inconsistent_range  TYPE C, "   
lv_show_linno  TYPE BOOLE_D, "   'X'
lv_show_linno_text  TYPE C, "   SPACE
lv_show_linno_text_len  TYPE C, "   '3'
lv_i_use_grid  TYPE C, "   ' '
lv_i_amodal_window  TYPE BOOLE-BOOLE, "   ' '
lv_no_messages  TYPE BOOLE, "   
lv_msg_selected  TYPE SMESG, "   
lv_corrections_func_text  TYPE ANY, "   SPACE
lv_e_exit_command  TYPE BAL_S_EXCM, "   
lv_msg_select_func  TYPE C, "   SPACE
lv_msg_select_func_text  TYPE ANY, "   SPACE
lv_line_from  TYPE ANY, "   SPACE
lv_line_to  TYPE ANY, "   SPACE
lv_object  TYPE ANY, "   SPACE
lv_send_if_one  TYPE BOOLE_D, "   SPACE
lv_batch_list_type  TYPE C. "   'J'

  CALL FUNCTION 'MESSAGES_SHOW'  "Display collected messages and associated long texts
    EXPORTING
         CORRECTIONS_OPTION = lv_corrections_option
         SHOW_LINNO = lv_show_linno
         SHOW_LINNO_TEXT = lv_show_linno_text
         SHOW_LINNO_TEXT_LEN = lv_show_linno_text_len
         I_USE_GRID = lv_i_use_grid
         I_AMODAL_WINDOW = lv_i_amodal_window
         CORRECTIONS_FUNC_TEXT = lv_corrections_func_text
         MSG_SELECT_FUNC = lv_msg_select_func
         MSG_SELECT_FUNC_TEXT = lv_msg_select_func_text
         LINE_FROM = lv_line_from
         LINE_TO = lv_line_to
         OBJECT = lv_object
         SEND_IF_ONE = lv_send_if_one
         BATCH_LIST_TYPE = lv_batch_list_type
    IMPORTING
         CORRECTIONS_WANTED = lv_corrections_wanted
         MSG_SELECTED = lv_msg_selected
         E_EXIT_COMMAND = lv_e_exit_command
    EXCEPTIONS
        INCONSISTENT_RANGE = 1
        NO_MESSAGES = 2
. " MESSAGES_SHOW




ABAP code using 7.40 inline data declarations to call FM MESSAGES_SHOW

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_corrections_option) = ' '.
 
 
 
DATA(ld_show_linno) = 'X'.
 
DATA(ld_show_linno_text) = ' '.
 
DATA(ld_show_linno_text_len) = '3'.
 
DATA(ld_i_use_grid) = ' '.
 
"SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_amodal_window).
DATA(ld_i_amodal_window) = ' '.
 
 
 
DATA(ld_corrections_func_text) = ' '.
 
 
DATA(ld_msg_select_func) = ' '.
 
DATA(ld_msg_select_func_text) = ' '.
 
DATA(ld_line_from) = ' '.
 
DATA(ld_line_to) = ' '.
 
DATA(ld_object) = ' '.
 
DATA(ld_send_if_one) = ' '.
 
DATA(ld_batch_list_type) = 'J'.
 


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!