Ansicht
Dokumentation

BAL_GLB_CONFIG_SET - Application Log: Global: Set configuration

BAL_GLB_CONFIG_SET - Application Log: Global: Set configuration

BAL_S_LOG - Application Log: Log header data   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

Set and read configuration
=======================================================================

You can configure the application log at the start of the transaction with the function module BAL_GLB_CONFIG_SET.
For this purpose, you have to transfer the import parameter I_S_CONFIGURATION, which has the structure BAL_S_CONF, to the function module.

You can get existing configurations with BAL_GLB_CONFIG_GET.

BAL_S_CONF specifies the messages which Application Log is to collect (component COLLECT) and which are to be output as soon as they are sent (component DISPLAY):

  • COLLECT-INACTIVE
    COLLECT-INACTIVE = 'X' completely deactivates message collection.
    COLLECT-ACTIVE = ' ' activates message collection.
  • COLLECT-MSG_FILTER, COLLECT-CON_FILTER
    Specifies which messages are to be collected by Application Log. These filter criteria refer to the message data, where COLLECT-MSG_FILTER filters by message attributes and COLLECT-CON_FILTER by message context.
    These filters have no effect if COLLECT-INACTIVE = 'X' is set.
  • DISPLAY-INACTIVE
    DISPLAY-INACTIVE = 'X' prevents any messages being displayed when they are sent to the Application Log.
    DISPLAY-INACTIVE = ' ' displays the messages with the callback routine specified in DISPLAY-CALLBACK. If DISPLAY-CALLBACK is empty, DISPLAY-INACTIVE = ' ' has no effect.
  • DISPLAY-MSG_FILTER, DISPLAY-CON_FILTER
    Specifies, analogously to collect, which messages are to be displayed (if DISPLAY-INACTIVE = ' ' and a callback routine was specified).
  • DISPLAY-CALLBACK
    This is the message display callback routine which is called when DISPLAY-INACTIVE = ' ' and a message satisfies the specified filter (see also here). This routine can only be used for T100 messages and not for exceptions.

Example 1
The parent program calls BAL_GLB_CONFIG_SET to ensure that the application log collects error messages and warnings only. All other message types are ignored.

Example 2
Important error messages should be displayed as an ABAP-MESSAGE as soon as they are sent (as well as normal log output at the end of the transaction).

Only one display routine is currently delivered in the standard system (function module BAL_DSP_MSG_DISPLAY_ABAP). This is useful if a check module is called as a background job and in dialog mode. You configure background processing in such a way that all messages are collected. In dialog mode, however, nothing is collected, but is output directly. A corresponding error message, for example, is then displayed in the PAI of a screen.

Other output routines may be developed in future releases (routines for displaying a message list in an amodal window, for example).

==>Note
Application log performance can deteriorate considerably if you use complex filters, because each message sent has to be checked to see whether it should be collected or displayed. For this reason, keep filters as simple as possible.
Do not use filters to implement customer-defined controls. (These are controllable error messages: The customer can specify conditions in Customizing that determine whether a message is to be collected, and with which message type). These conditions lead to complex filters.

==>Note
The message data, including defaults is used to check whether a message is collected or displayed.

The configuration affects the following function modules:
BAL_LOG_MSG_ADD Add message to log
BAL_LOG_EXCEPTION_ADD Add exception to log
BAL_LOG_MSG_CUMULATE Add message cumulatively
BAL_LOG_MSG_REPLACE Replace last message
BAL_LOG_MSG_ADD_FREE_TEXT Add message as free text

==> Note
This function module contains the optional authorization parameter I_AUTHORIZATION, which prevents "unauthorized" calls of function modules which perform critical activities such as initializations, in which case the exception NOT_AUTHORIZED is raised. See Authorization in Application Log.

Further information

Overview of the most important function groups

Quick start documentation

Application Log: Technical documentation





Parameters

I_AUTHORIZATION
I_S_CONFIGURATION

Exceptions

NOT_AUTHORIZED

Function Group

SBAL_TOOLBOX

BAL Application Log Documentation   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 5941 Date: 20240523 Time: 101841     sap01-206 ( 84 ms )