CL_DMC_LOG_HANDLER - Log handler for MWB/DTL

BAL Application Log Documentation   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Functionality

The log handler class is used to control the message processing.

Messages can be processed in several ways:

  • directly show single messages to the user (in dialog processing) or put them into the job log in case of background processing, as usually done by means of the MESSAGE statement
  • collect several messages which at the conclusion of a dialog processing step are shown together in a popup; optionally store these messages also in the database
  • create an application log on the database where the messages are stored
  • Any combination of the options listed above
  • Only count the messages for statistics, without showing them, or writing them to the database

The methods of this class both control the way how messages should be handled (see above) and provide ways how messages are created:

  • referring to the SY-fields for messages (method ADD_MESSAGE)
  • explicitly taking the message parameters via the interface (method SET_MESSAGE)
  • add free text to an application log (method ADD_TEXT)

Relationships

Example

Sequence of Method calls in typical scenarios

1 Dialog only (single message processing)

First call method CREATE_LOGHANDLER with behaviour "message only". All messages which are then raisedusing either of the methods ADD_MESSAGE, SET_MESSAGE or ADD_TEXT will be immediately shown to the user.This, of course, has an effect on the dialog control: In case of an E-message, further processing is inhibited, in case of an A-message, the transaction is aborted.

2 Reports

Here method CREATE_LOGHANDLER must be called with behaviour "log only" and with the parameters for theapplication log provided (especially subobject and external ID). If the report is running in background,method SAVE_LOG must be called to save the log to the database. If it is running in dialog, method SHOW_LOGcould be used to show the application log directly to the user, so that he does not need to switch to transaction SLG1 to view a log stored on the database.

3 Dialog which includes processing of many messages

Initially, method CREATE_LOGHANDLER is called with behaviour "message only". When the processing segmentwhich might produce many messages is entered, method SET_BEHAVIOUR should be called to change the behaviourto "log only" and to provide the parameters for the creation of the application log. When this processingsegment is left, method SHOW_LOG should be used to show the collected messages to the user. If then,single message processing should be reactivated, method RESET_BEHAVIOUR should be called to return to the initial behaviour.

4 A report is submitted and should use the same application log as the invoking module

The module that does the submit of the report calls method CREATE_LOGHANDLER with behaviour "log only".Then it uses method GET_LOGHANDLE to get the Id of the loghandle. This is then passed to the reportcalled with SUBMIT which also calls method CREATE_LOGHANDLER but passes the loghandle to make sure that the existing application log will be used.

Notes

Further information



CL_GUI_FRONTEND_SERVICES - Frontend Services   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.


Length: 3399 Date: 20120526 Time: 135802     triton ( 159 ms )