SAP CBRC_LIB_TRACE_MSG Function Module for Transfer of Message to Message Table
CBRC_LIB_TRACE_MSG is a standard cbrc lib trace msg SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Transfer of Message to Message Table 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 cbrc lib trace msg FM, simply by entering the name CBRC_LIB_TRACE_MSG into the relevant SAP transaction such as SE37 or SE38.
Function Group: CBRC_LIB
Program Name: SAPLCBRC_LIB
Main Program: SAPLCBRC_LIB
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CBRC_LIB_TRACE_MSG 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 'CBRC_LIB_TRACE_MSG'"Transfer of Message to Message Table.
EXPORTING
* I_MSGTY = SY-MSGTY "Messages, Message Type
* I_ALSORT = "Application Log: Sort Criterion/Grouping
* I_MSGID = SY-MSGID "Messages, Message Class
* I_MSGNO = SY-MSGNO "Messages, Message Number
* I_MSGV1 = SY-MSGV1 "Messages, Message Variable
* I_MSGV2 = SY-MSGV2 "Messages, Message Variable
* I_MSGV3 = SY-MSGV3 "Messages, Message Variable
* I_MSGV4 = SY-MSGV4 "Messages, Message Variable
* I_DETLEVEL = "Application Log: Level of Detail
* I_PROBCLASS = "Application Log: Message Problem Class
IMPORTING
ES_BALMI = "Application Log: APPL_LOG_WRITE_MESSAGES interface
CHANGING
* XT_BALMI = "Table Type Application Log
IMPORTING Parameters details for CBRC_LIB_TRACE_MSG
I_MSGTY - Messages, Message Type
Data type: BALMI-MSGTYDefault: SY-MSGTY
Optional: Yes
Call by Reference: Yes
I_ALSORT - Application Log: Sort Criterion/Grouping
Data type: BALMI-ALSORTOptional: Yes
Call by Reference: Yes
I_MSGID - Messages, Message Class
Data type: BALMI-MSGIDDefault: SY-MSGID
Optional: Yes
Call by Reference: Yes
I_MSGNO - Messages, Message Number
Data type: BALMI-MSGNODefault: SY-MSGNO
Optional: Yes
Call by Reference: Yes
I_MSGV1 - Messages, Message Variable
Data type: BALMI-MSGV1Default: SY-MSGV1
Optional: Yes
Call by Reference: Yes
I_MSGV2 - Messages, Message Variable
Data type: BALMI-MSGV2Default: SY-MSGV2
Optional: Yes
Call by Reference: Yes
I_MSGV3 - Messages, Message Variable
Data type: BALMI-MSGV3Default: SY-MSGV3
Optional: Yes
Call by Reference: Yes
I_MSGV4 - Messages, Message Variable
Data type: BALMI-MSGV4Default: SY-MSGV4
Optional: Yes
Call by Reference: Yes
I_DETLEVEL - Application Log: Level of Detail
Data type: BALMI-DETLEVELOptional: Yes
Call by Reference: Yes
I_PROBCLASS - Application Log: Message Problem Class
Data type: BALMI-PROBCLASSOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for CBRC_LIB_TRACE_MSG
ES_BALMI - Application Log: APPL_LOG_WRITE_MESSAGES interface
Data type: BALMIOptional: No
Call by Reference: Yes
CHANGING Parameters details for CBRC_LIB_TRACE_MSG
XT_BALMI - Table Type Application Log
Data type: CCRCTT_MSGOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for CBRC_LIB_TRACE_MSG 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_i_msgty | TYPE BALMI-MSGTY, " SY-MSGTY | |||
| lv_es_balmi | TYPE BALMI, " | |||
| lv_xt_balmi | TYPE CCRCTT_MSG, " | |||
| lv_i_alsort | TYPE BALMI-ALSORT, " | |||
| lv_i_msgid | TYPE BALMI-MSGID, " SY-MSGID | |||
| lv_i_msgno | TYPE BALMI-MSGNO, " SY-MSGNO | |||
| lv_i_msgv1 | TYPE BALMI-MSGV1, " SY-MSGV1 | |||
| lv_i_msgv2 | TYPE BALMI-MSGV2, " SY-MSGV2 | |||
| lv_i_msgv3 | TYPE BALMI-MSGV3, " SY-MSGV3 | |||
| lv_i_msgv4 | TYPE BALMI-MSGV4, " SY-MSGV4 | |||
| lv_i_detlevel | TYPE BALMI-DETLEVEL, " | |||
| lv_i_probclass | TYPE BALMI-PROBCLASS. " |
|   CALL FUNCTION 'CBRC_LIB_TRACE_MSG' "Transfer of Message to Message Table |
| EXPORTING | ||
| I_MSGTY | = lv_i_msgty | |
| I_ALSORT | = lv_i_alsort | |
| I_MSGID | = lv_i_msgid | |
| I_MSGNO | = lv_i_msgno | |
| I_MSGV1 | = lv_i_msgv1 | |
| I_MSGV2 | = lv_i_msgv2 | |
| I_MSGV3 | = lv_i_msgv3 | |
| I_MSGV4 | = lv_i_msgv4 | |
| I_DETLEVEL | = lv_i_detlevel | |
| I_PROBCLASS | = lv_i_probclass | |
| IMPORTING | ||
| ES_BALMI | = lv_es_balmi | |
| CHANGING | ||
| XT_BALMI | = lv_xt_balmi | |
| . " CBRC_LIB_TRACE_MSG | ||
ABAP code using 7.40 inline data declarations to call FM CBRC_LIB_TRACE_MSG
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 MSGTY FROM BALMI INTO @DATA(ld_i_msgty). | ||||
| DATA(ld_i_msgty) | = SY-MSGTY. | |||
| "SELECT single ALSORT FROM BALMI INTO @DATA(ld_i_alsort). | ||||
| "SELECT single MSGID FROM BALMI INTO @DATA(ld_i_msgid). | ||||
| DATA(ld_i_msgid) | = SY-MSGID. | |||
| "SELECT single MSGNO FROM BALMI INTO @DATA(ld_i_msgno). | ||||
| DATA(ld_i_msgno) | = SY-MSGNO. | |||
| "SELECT single MSGV1 FROM BALMI INTO @DATA(ld_i_msgv1). | ||||
| DATA(ld_i_msgv1) | = SY-MSGV1. | |||
| "SELECT single MSGV2 FROM BALMI INTO @DATA(ld_i_msgv2). | ||||
| DATA(ld_i_msgv2) | = SY-MSGV2. | |||
| "SELECT single MSGV3 FROM BALMI INTO @DATA(ld_i_msgv3). | ||||
| DATA(ld_i_msgv3) | = SY-MSGV3. | |||
| "SELECT single MSGV4 FROM BALMI INTO @DATA(ld_i_msgv4). | ||||
| DATA(ld_i_msgv4) | = SY-MSGV4. | |||
| "SELECT single DETLEVEL FROM BALMI INTO @DATA(ld_i_detlevel). | ||||
| "SELECT single PROBCLASS FROM BALMI INTO @DATA(ld_i_probclass). | ||||
Search for further information about these or an SAP related objects