Fonction SAP TR_WRITE_LOG - Write log

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
IV_APPEND_MODE TRPARI-FLAG C 1 ' ' X Memory log: Append messages
IV_CONDENSE TRPARI-FLAG C 1 'X' X Lines are condensed
IV_LOGNAME_DB DDPRH-PROTNAME C 40 X Name of log (database)
IV_LOGNAME_FILE TSTRF01-FILE C 255 X Name of log (file)
IV_LOGNAME_MEMORY TSTRF01-FILENAME C 32 X Name of log (memory)
IV_LOG_TYPE TRLOG_TYPE 0 'FILE' X Log type: 'FILE', 'DB', 'MEMORY'

Paramètre Reférence Long. Facultatif Description
IT_MSGS SPROT_U 227 Table with messages

Exception Description
DB_ACCESS_ERROR Error Accessing Database
FILE_ACCESS_ERROR Error accessing file
INVALID_INPUT Invalid entry

Functionality
This function module writes logs either

  • to a file at operating system level

  • to the database

  • to memory

  • The import parameter "IV_LOG_TYPE" determines where the logs arewritten. Possible values are
    • "FILE" for a file at operating system level

    • "DB" for the database

    • "MEMORY" for memory

    • The name of the log is passed with the import parameters"IV_LOGNAME_FILE", "IV_LOGNAME_DB", and "IV_LOGNAME_MEMORY".
      The messages that should be stored are then passed in the tableIT_MSGS. An example of how this table could be filled is given furtherbelow in this documentation.
      If the import parameter "IV_APPEND_MODE" is set, the memory log isadded, and not replaced.

      Notes
      You can use the function module TR_READ_AND_DISPLAY_LOG to read theselogs and display them on the screen.
      Special handling is currently implemented for the following messages:

      • PU 320: Branch to job log

      • If the job name is passed in field VAR1, the job number in field VAR2and the system name in VAR3, you can branch to the job log from thismessage line in the display, as long as the job exists.
        • PU 321: Branch to editors

        • The object type must be passed in the field VAR1 and the object name inthe field VAR2. You can then branch directly to the editors.
          Example:
          "PROG" "RSWBO040" branch to ABAP editor for report RSWBO040.

          Further information
          Example for table IT_MSGS:
          LEVEL SEVERITY LANGU AG MSGNR NEWOBJ VAR1 VAR2 VAR3 VAR4
          1 'W' E TO 070 'X' TEST
          2 ' ' E PU 321 ' ' PROG RSWBO040
          2 ' ' E PU 320 ' ' JOB 12345678

          Notes
          The field 'LEVEL' in the first row of the table IT_MSGS should contain'1', if the function module TR_READ_AND_DISPLAY_LOG is called withIV_DISPLAY_LEVEL = '1'.

711251BP_TR2: COMPUTE_BCD_OVERFLOW during BP conversion