Ansicht
Dokumentation
BAL_DB_SAVE - Application Log: Database: Save logs
General Data in Customer Master Vendor Master (General Section)This documentation is copyright by SAP AG.
Functionality
You can save logs in memory in the database with the function module BAL_DB_SAVE. You can save all data in memory (Importing parameter I_SAVE_ALL = 'X') or a subset specified by a set of log handles (Importing parameter I_T_LOG_HANDLE).
You can get the log handle table by calling the function module BAL_GLB_SEARCH_LOG which searches for logs in memory by specified filter criteria.
When logs are saved, an internal log number is issued (field LOGNUMBER). At runtime this field has a temporary value (e.g. $00001).
The function module BAL_DB_SAVE returns a table (Exporting parameter E_NEW_LOGNUMBERS) which relates LOG_HANDLE, external number EXTNUMBER, temporary LOGNUMBER and permanent LOGNUMBER, so you can find out which number was assigned to a log after saving.
You can also save IN UPDATE TASK (Importing parameter I_IN_UPDATE_TASK = 'X').
You can also save the logs in another client (parameter I_CLIENT). If you do not specify I_CLIENT, you save in the current client.
Notes
After logs have been saved they are still in memory in a state as though they had just been loaded from the database. To delete saved logs from memory, use either the function module BAL_LOG_REFRESH (for one log) or BAL_GLB_MEMORY_REFRESH (for several or all logs).
The field LOGNUMBER is still visible to the caller for reasons of compatibility, but it only has a temporary
value at runtime and only becomes permanent after saving, so all application tables which point to a log with the LOGNUMBER must be updated when saving.
If you use the LOG_HANDLE field, this is not necessary. LOG_HANDLE has its permanent value as soon as a log is created (with BAL_LOG_CREATE).
Example
Report SBAL_DEMO_05 (==>Run ==>Coding) simulates a settlement run for all flights on a specified date. You can choose:
- Simulate settlement.
The documents are only collected in memory with temporary numbers, which are logged.
- Perform settlement.
A log is saved in the database after the temporary document numbers have been replaced by permanent ones in the log.
- Display logs.
Related function modules
Save and read logs
Delete logs
Further information
Overview of the most important function groups
Application Log: Technical documentation
Parameters
E_NEW_LOGNUMBERSE_SECOND_CONNECTION
I_2TH_CONNECTION
I_2TH_CONNECT_COMMIT
I_CLIENT
I_IN_UPDATE_TASK
I_LINK2JOB
I_SAVE_ALL
I_T_LOG_HANDLE
Exceptions
LOG_NOT_FOUNDNUMBERING_ERROR
SAVE_NOT_ALLOWED
Function Group
SBAL_DBAddresses (Business Address Services) PERFORM Short Reference
This documentation is copyright by SAP AG.
Length: 4216 Date: 20240513 Time: 221038 sap01-206 ( 78 ms )