Copyright 2024 - BV TallVision IT

Some inbound Idoc processing modules can populate their error messages on the application log rather than in status 51 messages... The application log or BAL (Business Application Log) is in effect a cross-component logging facility where processes such as processing an inbound Idoc can place messages. It can also be used for your own custom development ! The end user can browse through the "reported objects" (in our case an Idoc in status 51).

An example of this "enhanced Idoc error reporting" is the inbound processing for classification values, message type CLFMAS and inbound processing module IDOC_INPUT_CLFMAS. When this module is called and it encounters problems, it will set it's Idoc status to status 51 (error) "Error processing IDOC - please see log". The IDOC_STATUS response also holds a field called APPL_LOG (See EDIDS-APPL_LOG), which holds the number of the application log that was created. You will find your error messages there.

On the status message detail in WE02 (and many other Idoc reports) a button "Application log" is available. This will show error details from tha application log. If you would like to do the same, with a lognnumber use function module APPL_LOG_DISPLAY_WITH_LOGNO.

Using the function module to display the application log is a little tricky, as it uses type references from a type pool, rather than DDIC references. Here's how this can be used:

TYPE-POOLS SZAL.

  data: lt_SZAL_LOGNUMBERS type SZAL_LOGNUMBERS,
        lw_SZAL_LOGNUMBER type SZAL_LOGNUMBER.

* Call to SLG1 - Application log
  clear: lt_SZAL_LOGNUMBERS[], lw_SZAL_LOGNUMBER.
  lw_SZAL_LOGNUMBER-item = my_log_number.
  append lw_SZAL_LOGNUMBER to lt_SZAL_LOGNUMBERS.
  CALL FUNCTION 'APPL_LOG_DISPLAY_WITH_LOGNO'
    EXPORTING
      TITLE_LIST_SCREEN = 'Application log for Idoc'
    TABLES
      LOGNUMBERS        = lt_SZAL_LOGNUMBERS
    EXCEPTIONS
      OTHERS            = 0.

The application log can be accessed via transaction SLG1 - "Evaluate application log". A transaction which will report all BAL errors or warnings and even success messages depending on settings accross the whole system.