R3_GET_SYSTEMLOG

Reads the system log of an SAP system during a specified time period.

Transaction: SM21
Interface: Standard

Syntax

R3_GET_SYSTEMLOG

    FILE=...
    [,SERVER=...]
    [,FROM_DATE=...]
    [,FROM_TIME=...]
    [,TO_DATE=...]
    [,TO_TIME=...]

Syntax

Description/Format

FILE= 

Name of a file to which the read SAP system log should be stored.
Format: Name or script literal

SERVER= 

Name of an SAP application server.
Format: Name or script literal

The name of an SAP application server must be specified in the form Host_SID_SYSNR:
Host
= Computer name
SID
= System ID from SAP
SYSNR
= Number of the SAP Instance 

FROM_DATE= 

Start date of the selection from the system log.
Format: YYYYMMDD

Default value: "20010101" 

FROM_TIME= 

Start time of the selection from the system log.
Format: HHMMSS

Default value: "000000" 

TO_DATE= 

End date of the selection from the system log.
Format: YYYYMMDD

Default value: current date 

TO_TIME= 

End time of the selection from the system log.
Format: HHMMSS

Default value: "235959" 

ENCODING=

(Optional) Encoding that should be used for the generated output file (FILE= parameter).

Example: UTF-8

Default value: ISO-8859-1

When you specify an encoding format that is not supported or invalid, the job aborts with an error message.

The SAP Forms provide an input assistant for this field which lists all the supported encoding formats.

This script element is used to read the system log of an SAP system as text and saving it to a file. If the name of an application server is specified, the script element supplies this server's system log. Without the name of an application server being entered, the central SAP system log is read.

You can also prepare and edit the system log using the script elements for the data sequences. R3_GET_SYSTEMLOG is used in the event job "EVENT.R3SYSLOG" in client 0000.

Tips:

  • Use the PREP_PROCESS script function to create a data sequence with the data of the system log. For more information, see PREP_PROCESS.
  • Use a process loop to process the data sequence line by line. For more information, see :PROCESS... :TERM_PROCESS... :ENDPROCESS.
  • Read data in individual lines or columns of the data sequence. For more information, see GET_PROCESS_LINE.

Note: Note that by default, created files are saved on the computer on which the agent has been installed  (for example, R3_GET_JOB_SPOOL; FILE=).

Example

The following example reads the central SAP system log of the previous week. The start date for the system log selection is calculated using the script function SUB_DAYS. The current date is the basis of this calculation.

:RSET &TODAY#          = SYS_DATE ('YYYYMMDD')
:
RSET&LAST_WEEK#      = SUB_DAYS ('YYYYMMDD:&TODAY#', 7)
R3_GET_SYSTEMLOG FILE = 'c:\t46_systemlog.txt', SERVER=, FROM_DATE='&LAST_WEEK#'

See also:

seealso

About SAP JCL