Ansicht
Dokumentation

BAL_LOG_MSG_REPLACE - Application Log: Log: Message: Replace last

BAL_LOG_MSG_REPLACE - Application Log: Log: Message: Replace last

ABAP Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

The most recent Application Log message is deleted and replaced by a new message.

The new message data is in the IMPORTING parameter I_S_MSG (structure BAL_S_MSG). A message handle E_S_MSG_HANDLE, which uniquely identifies the message, is returned.

In which log is the new message put?

  • If a log handle is passed in I_LOG_HANDLE, the message is put in that log.
  • Otherwise it is put in the same log as the deleted message.
  • If there is no old message and no log is specified in I_LOG_HANDLE, the message is put in the default log (see here).

Why replace the last message?

The function module BAL_LOG_MSG_REPLACE can overwrite a message sent to the Application Log by an external program, with your own message.

Example
A generic scheduling module is called to calculate a flight schedule. If scheduling fails, the function module may send a relatively technical message: "Scheduling of procedure 0006 unsuccessful". As messages should always be logged where they occur, this module sends a message to the Application Log. The message "The flight from Hamburg to New York could not be scheduled" would be much more meaningful to the user.

==>Note
You can also get the handle of the last message sent with BAL_GLB_MSG_CURRENT_HANDLE_GET. This can be useful if you want to delete or change the last message, not replace it (with BAL_LOG_MSG_DELETE) or ( BAL_LOG_MSG_CHANGE) respectively.

The Application Log configuration controls whether a message is directly displayed or collected. The Exporting parameters E_MSG_WAS_DISPLAYED and E_MSG_WAS_LOGGED tell you what was done with the message.

Related function modules

Message collection methods

Further information

Overview of the most important function groups

Quick start documentation

Application Log: Technical documentation





Parameters

E_MSG_WAS_DISPLAYED
E_MSG_WAS_LOGGED
E_S_MSG_HANDLE
I_LOG_HANDLE
I_S_MSG

Exceptions

LOG_IS_FULL
LOG_NOT_FOUND
MSG_INCONSISTENT

Function Group

SBAL_TOOLBOX

ROGBILLS - Synchronize billing plans   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 3666 Date: 20240601 Time: 234257     sap01-206 ( 52 ms )