Automation Engine Script Guide > AE JCL for Applications > SAP > R3_GET_SYSTEMLOG

R3_GET_SYSTEMLOG

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

Transaction: SM21

Interface: Standard

Syntax

R3_GET_SYSTEMLOG

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=

Encoding for the generated output file (Parameter FILE=).

For example: UTF-8

Default value: ISO-8859-1

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

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

Comments

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. The script function PREP_PROCESS can be used to create a data sequence with the system log's data.

The data sequence is processed with the script statements :PROCESS and :ENDPROCESS. Each individual line of the data sequence and its columns can be accessed with the script function GET_PROCESS_LINE.

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: