SAP CBRC_LIB_WRITE Function Module for NOTRANSL: Sichern von Meldungen
CBRC_LIB_WRITE is a standard cbrc lib write SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Sichern von Meldungen 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 write FM, simply by entering the name CBRC_LIB_WRITE 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_WRITE 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_WRITE'"NOTRANSL: Sichern von Meldungen.
EXPORTING
I_OBJECT = "Application Log: Object Name (Application Code)
I_SUBOBJECT = "Application Log: Subobject
I_LOGHEADER = "Application Log: APPL_LOG_WRITE_HEADER interface
I_EXT_NUMBER = "Application Log: External Identification
ALDATE_DEL = "Application Log: Expiry Date
* I_SAVE = TRUE "
IMPORTING
E_LOGHANDLE = "Application Log: Log Handle
E_LOGNUMBER = "Application Log: Log Number
TABLES
IT_MSG = "Application Log: Table with Messages
EXCEPTIONS
LOG_NOT_FOUND = 1 SAVE_NOT_ALLOWED = 2 NUMBERING_ERROR = 3
IMPORTING Parameters details for CBRC_LIB_WRITE
I_OBJECT - Application Log: Object Name (Application Code)
Data type: BALHDR-OBJECTOptional: No
Call by Reference: Yes
I_SUBOBJECT - Application Log: Subobject
Data type: BALHDR-SUBOBJECTOptional: No
Call by Reference: Yes
I_LOGHEADER - Application Log: APPL_LOG_WRITE_HEADER interface
Data type: BALHDRIOptional: No
Call by Reference: Yes
I_EXT_NUMBER - Application Log: External Identification
Data type: BALNREXTOptional: No
Call by Reference: Yes
ALDATE_DEL - Application Log: Expiry Date
Data type: ALDATE_DELOptional: No
Call by Reference: Yes
I_SAVE -
Data type: ESP1_BOOLEANDefault: TRUE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for CBRC_LIB_WRITE
E_LOGHANDLE - Application Log: Log Handle
Data type: BALLOGHNDLOptional: No
Call by Reference: No ( called with pass by value option)
E_LOGNUMBER - Application Log: Log Number
Data type: BALOGNROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CBRC_LIB_WRITE
IT_MSG - Application Log: Table with Messages
Data type: BAL_T_MSGOptional: No
Call by Reference: Yes
EXCEPTIONS details
LOG_NOT_FOUND - Log not found
Data type:Optional: No
Call by Reference: Yes
SAVE_NOT_ALLOWED - Cannot Save
Data type:Optional: No
Call by Reference: Yes
NUMBERING_ERROR - Error during number assignment
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CBRC_LIB_WRITE 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_it_msg | TYPE STANDARD TABLE OF BAL_T_MSG, " | |||
| lv_i_object | TYPE BALHDR-OBJECT, " | |||
| lv_e_loghandle | TYPE BALLOGHNDL, " | |||
| lv_log_not_found | TYPE BALLOGHNDL, " | |||
| lv_e_lognumber | TYPE BALOGNR, " | |||
| lv_i_subobject | TYPE BALHDR-SUBOBJECT, " | |||
| lv_save_not_allowed | TYPE BALHDR, " | |||
| lv_i_logheader | TYPE BALHDRI, " | |||
| lv_numbering_error | TYPE BALHDRI, " | |||
| lv_i_ext_number | TYPE BALNREXT, " | |||
| lv_aldate_del | TYPE ALDATE_DEL, " | |||
| lv_i_save | TYPE ESP1_BOOLEAN. " TRUE |
|   CALL FUNCTION 'CBRC_LIB_WRITE' "NOTRANSL: Sichern von Meldungen |
| EXPORTING | ||
| I_OBJECT | = lv_i_object | |
| I_SUBOBJECT | = lv_i_subobject | |
| I_LOGHEADER | = lv_i_logheader | |
| I_EXT_NUMBER | = lv_i_ext_number | |
| ALDATE_DEL | = lv_aldate_del | |
| I_SAVE | = lv_i_save | |
| IMPORTING | ||
| E_LOGHANDLE | = lv_e_loghandle | |
| E_LOGNUMBER | = lv_e_lognumber | |
| TABLES | ||
| IT_MSG | = lt_it_msg | |
| EXCEPTIONS | ||
| LOG_NOT_FOUND = 1 | ||
| SAVE_NOT_ALLOWED = 2 | ||
| NUMBERING_ERROR = 3 | ||
| . " CBRC_LIB_WRITE | ||
ABAP code using 7.40 inline data declarations to call FM CBRC_LIB_WRITE
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 OBJECT FROM BALHDR INTO @DATA(ld_i_object). | ||||
| "SELECT single SUBOBJECT FROM BALHDR INTO @DATA(ld_i_subobject). | ||||
| DATA(ld_i_save) | = TRUE. | |||
Search for further information about these or an SAP related objects