SAP BAL_DB_SAVE Function Module for Application Log: Database: Save logs
BAL_DB_SAVE is a standard bal db save SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Application Log: Database: Save logs 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 bal db save FM, simply by entering the name BAL_DB_SAVE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SBAL_DB
Program Name: SAPLSBAL_DB
Main Program: SAPLSBAL_DB
Appliation area: S
Release date: 26-Apr-1999
Mode(Normal, Remote etc): Normal Function Module
Update:
Function BAL_DB_SAVE 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 'BAL_DB_SAVE'"Application Log: Database: Save logs.
EXPORTING
* I_CLIENT = SY-MANDT "Client in which the new log is to be saved
* I_IN_UPDATE_TASK = ' ' "Save in UPDATE TASK
* I_SAVE_ALL = ' ' "Save all logs in memory
* I_T_LOG_HANDLE = "Table of log handles
* I_2TH_CONNECTION = ' ' "FALSE: No secondary connection
* I_2TH_CONNECT_COMMIT = ' ' "FALSE: No COMMIT in module
* I_LINK2JOB = 'X' "Boolean Variable (X = True, - = False, Space = Unknown)
IMPORTING
E_NEW_LOGNUMBERS = "Table of new log numbers
E_SECOND_CONNECTION = "Name of Secondary Connection
EXCEPTIONS
LOG_NOT_FOUND = 1 SAVE_NOT_ALLOWED = 2 NUMBERING_ERROR = 3
IMPORTING Parameters details for BAL_DB_SAVE
I_CLIENT - Client in which the new log is to be saved
Data type: SY-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_IN_UPDATE_TASK - Save in UPDATE TASK
Data type: BOOLEANDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SAVE_ALL - Save all logs in memory
Data type: BOOLEANDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_T_LOG_HANDLE - Table of log handles
Data type: BAL_T_LOGHOptional: Yes
Call by Reference: No ( called with pass by value option)
I_2TH_CONNECTION - FALSE: No secondary connection
Data type: BOOLEANDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_2TH_CONNECT_COMMIT - FALSE: No COMMIT in module
Data type: BOOLEANDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LINK2JOB - Boolean Variable (X = True, - = False, Space = Unknown)
Data type: BOOLEANDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAL_DB_SAVE
E_NEW_LOGNUMBERS - Table of new log numbers
Data type: BAL_T_LGNMOptional: No
Call by Reference: No ( called with pass by value option)
E_SECOND_CONNECTION - Name of Secondary Connection
Data type: DBCON_NAMEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
LOG_NOT_FOUND - Log not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SAVE_NOT_ALLOWED - Cannot save
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NUMBERING_ERROR - Number assignment error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAL_DB_SAVE 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_client | TYPE SY-MANDT, " SY-MANDT | |||
lv_log_not_found | TYPE SY, " | |||
lv_e_new_lognumbers | TYPE BAL_T_LGNM, " | |||
lv_i_in_update_task | TYPE BOOLEAN, " SPACE | |||
lv_save_not_allowed | TYPE BOOLEAN, " | |||
lv_e_second_connection | TYPE DBCON_NAME, " | |||
lv_i_save_all | TYPE BOOLEAN, " SPACE | |||
lv_numbering_error | TYPE BOOLEAN, " | |||
lv_i_t_log_handle | TYPE BAL_T_LOGH, " | |||
lv_i_2th_connection | TYPE BOOLEAN, " SPACE | |||
lv_i_2th_connect_commit | TYPE BOOLEAN, " SPACE | |||
lv_i_link2job | TYPE BOOLEAN. " 'X' |
  CALL FUNCTION 'BAL_DB_SAVE' "Application Log: Database: Save logs |
EXPORTING | ||
I_CLIENT | = lv_i_client | |
I_IN_UPDATE_TASK | = lv_i_in_update_task | |
I_SAVE_ALL | = lv_i_save_all | |
I_T_LOG_HANDLE | = lv_i_t_log_handle | |
I_2TH_CONNECTION | = lv_i_2th_connection | |
I_2TH_CONNECT_COMMIT | = lv_i_2th_connect_commit | |
I_LINK2JOB | = lv_i_link2job | |
IMPORTING | ||
E_NEW_LOGNUMBERS | = lv_e_new_lognumbers | |
E_SECOND_CONNECTION | = lv_e_second_connection | |
EXCEPTIONS | ||
LOG_NOT_FOUND = 1 | ||
SAVE_NOT_ALLOWED = 2 | ||
NUMBERING_ERROR = 3 | ||
. " BAL_DB_SAVE |
ABAP code using 7.40 inline data declarations to call FM BAL_DB_SAVE
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 MANDT FROM SY INTO @DATA(ld_i_client). | ||||
DATA(ld_i_client) | = SY-MANDT. | |||
DATA(ld_i_in_update_task) | = ' '. | |||
DATA(ld_i_save_all) | = ' '. | |||
DATA(ld_i_2th_connection) | = ' '. | |||
DATA(ld_i_2th_connect_commit) | = ' '. | |||
DATA(ld_i_link2job) | = 'X'. | |||
Search for further information about these or an SAP related objects