SAP MESSAGES_INITIALIZE Function Module for Delete messages collected up to now, collect future messages
MESSAGES_INITIALIZE is a standard messages initialize SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Delete messages collected up to now, collect future messages 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 initialize FM, simply by entering the name MESSAGES_INITIALIZE 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_INITIALIZE 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_INITIALIZE'"Delete messages collected up to now, collect future messages.
EXPORTING
* COLLECT_AND_SEND = ' ' "Collect and Output if x
* I_RESET_LINE = 'X' "Reset Line Set by MESSAGE_LINE_SET
* RESET = 'X' "Reset collected messages if x
* LINE_FROM = ' ' "Restrict Messages to Be Reset
* LINE_TO = ' ' "Restrict Messages to Be Reset
* I_STORE_DUPLICATES = 'X' "Save Identical Messages More than Once (-> Improves Performance)
* I_NO_DUPLICATE_COUNT = 500 "Number of messages up to which no duplicates are saved
* I_IDENTIFICATION = "Identification from First Call
* CHECK_ON_COMMIT = 'X' "Not used
* I_ALLOW_FOREIGN_RESET = 'X' "Cancelation Without ID Allowed
IMPORTING
E_IDENTIFICATION = "Identification
EXCEPTIONS
LOG_NOT_ACTIVE = 1 WRONG_IDENTIFICATION = 2
IMPORTING Parameters details for MESSAGES_INITIALIZE
COLLECT_AND_SEND - Collect and Output if x
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_RESET_LINE - Reset Line Set by MESSAGE_LINE_SET
Data type: BOOLE-BOOLEDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
RESET - Reset collected messages if x
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LINE_FROM - Restrict Messages to Be Reset
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LINE_TO - Restrict Messages to Be Reset
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_STORE_DUPLICATES - Save Identical Messages More than Once (-> Improves Performance)
Data type: BOOLE_DDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_NO_DUPLICATE_COUNT - Number of messages up to which no duplicates are saved
Data type: SYTABIXDefault: 500
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_IDENTIFICATION - Identification from First Call
Data type: SY-UZEITOptional: Yes
Call by Reference: No ( called with pass by value option)
CHECK_ON_COMMIT - Not used
Data type: SY-BATCHDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ALLOW_FOREIGN_RESET - Cancelation Without ID Allowed
Data type: BOOLE-BOOLEDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MESSAGES_INITIALIZE
E_IDENTIFICATION - Identification
Data type: SY-UZEITOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
LOG_NOT_ACTIVE - Log not active -> no reset
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_IDENTIFICATION - Identification not correct (-> long text)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MESSAGES_INITIALIZE 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_log_not_active | TYPE STRING, " | |||
lv_collect_and_send | TYPE STRING, " SPACE | |||
lv_e_identification | TYPE SY-UZEIT, " | |||
lv_i_reset_line | TYPE BOOLE-BOOLE, " 'X' | |||
lv_reset | TYPE BOOLE, " 'X' | |||
lv_wrong_identification | TYPE BOOLE, " | |||
lv_line_from | TYPE BOOLE, " SPACE | |||
lv_line_to | TYPE BOOLE, " SPACE | |||
lv_i_store_duplicates | TYPE BOOLE_D, " 'X' | |||
lv_i_no_duplicate_count | TYPE SYTABIX, " 500 | |||
lv_i_identification | TYPE SY-UZEIT, " | |||
lv_check_on_commit | TYPE SY-BATCH, " 'X' | |||
lv_i_allow_foreign_reset | TYPE BOOLE-BOOLE. " 'X' |
  CALL FUNCTION 'MESSAGES_INITIALIZE' "Delete messages collected up to now, collect future messages |
EXPORTING | ||
COLLECT_AND_SEND | = lv_collect_and_send | |
I_RESET_LINE | = lv_i_reset_line | |
RESET | = lv_reset | |
LINE_FROM | = lv_line_from | |
LINE_TO | = lv_line_to | |
I_STORE_DUPLICATES | = lv_i_store_duplicates | |
I_NO_DUPLICATE_COUNT | = lv_i_no_duplicate_count | |
I_IDENTIFICATION | = lv_i_identification | |
CHECK_ON_COMMIT | = lv_check_on_commit | |
I_ALLOW_FOREIGN_RESET | = lv_i_allow_foreign_reset | |
IMPORTING | ||
E_IDENTIFICATION | = lv_e_identification | |
EXCEPTIONS | ||
LOG_NOT_ACTIVE = 1 | ||
WRONG_IDENTIFICATION = 2 | ||
. " MESSAGES_INITIALIZE |
ABAP code using 7.40 inline data declarations to call FM MESSAGES_INITIALIZE
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_collect_and_send) | = ' '. | |||
"SELECT single UZEIT FROM SY INTO @DATA(ld_e_identification). | ||||
"SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_reset_line). | ||||
DATA(ld_i_reset_line) | = 'X'. | |||
DATA(ld_reset) | = 'X'. | |||
DATA(ld_line_from) | = ' '. | |||
DATA(ld_line_to) | = ' '. | |||
DATA(ld_i_store_duplicates) | = 'X'. | |||
DATA(ld_i_no_duplicate_count) | = 500. | |||
"SELECT single UZEIT FROM SY INTO @DATA(ld_i_identification). | ||||
"SELECT single BATCH FROM SY INTO @DATA(ld_check_on_commit). | ||||
DATA(ld_check_on_commit) | = 'X'. | |||
"SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_allow_foreign_reset). | ||||
DATA(ld_i_allow_foreign_reset) | = 'X'. | |||
Search for further information about these or an SAP related objects