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. |
SERVER= |
Name of an SAP application server. The name of an SAP application server must
be specified in the form Host_SID_SYSNR: |
FROM_DATE= |
Start date of the selection from the system log. Default value: "20010101" |
FROM_TIME= |
Start time of the selection from the system log. Default value: "000000" |
TO_DATE= |
End date of the selection from the system log. Default value: current date |
TO_TIME= |
End time of the selection from the system log. Default value: "235959" |
ENCODING= |
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