R3_GET_SESSIONS
Use the R3_GET_SESSIONS script element to select batch input sessions and list the results in the activation report or in a file. There is one line per found session. In the activation report, fields are separated by a semicolon, with a timestamp and an AE message number at the beginning of each line. In a file, results are presented in fixed columns — the first line of the file describes the column names and widths. The first 13 positions contain the session name, the next 21 positions the queue ID, and the last 13 positions the creator (user). By default, generated files are stored on the computer on which the agent is installed.
Tip: You can analyze the selection results using script functions. Use PREP_PROCESS_REPORT on the Post Process page to analyze the activation report, or PREP_PROCESS_FILE when the result is stored in a file. For more information, see:
Transaction: SM35
Interface: AE
Syntax
R3_GET_SESSIONS NAME=...,CREDATE_FROM=...,CREDATE_TO=...,STATUS=...[,FILE=...][,NOFOUND=...][,ORDER_BY=...][,ENCODING=...]
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| NAME= | Selects batch input sessions by name. You can use the "*" (any characters) and "?" (exactly one character) wildcard characters. | Script literal | n.a. | n.a. |
| CREDATE_FROM= | Start date for selecting batch input sessions by creation date. | Script literal | n.a. | n.a. |
| CREDATE_TO= | End date for selecting batch input sessions by creation date. | Script literal | n.a. | n.a. |
| STATUS= | Selects batch input sessions by status. | Script literal |
|
" " |
| FILE=
(Optional) |
Name of the file to which the selection results are written. When specified, results are not written to the activation report. Each line contains the session name (13 characters) followed by the queue ID (21 characters). | Script literal | n.a. | n.a. |
| NOFOUND=
(Optional) |
Action to take if no sessions are found. | Script literal |
|
NORMAL |
| ORDER_BY=
(Optional) |
Sorts the selection results by the specified criteria. All field names of the SAP table APQI can be used. Example: ORDER_BY=GROUPID |
n.a. | n.a. | n.a. |
| ENCODING=
(Optional) |
(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. |
n.a. | n.a. | n.a. |
Examples
The following example selects all batch input sessions named "NI" that are waiting to be processed today.
: SET &TODAY# = SYS_DATE (YYYYMMDD)
R3_GET_SESSIONS NAME='NI',CREDATE_FROM='&TODAY#',CREDATE_TO='&TODAY#',STATUS=" "
The activation report shows lines similar to the following:
20220313/135601.000 - U2004943 ;AE_TEST;20220312NI;NI
The following example selects all batch input sessions created between 1/1/2020 and 1/1/2022 that resulted in errors. The result is stored in a file.
R3_GET_SESSIONS NAME='*',CREDATE_FROM='20200101',CREDATE_TO='20220101',STATUS='E',FILE='sessions.txt'
The first lines of the file may look as follows:
COL=LENGTH,LENGTH_TAB='13=GROUPID,21=QID,13=CREATOR'
AE_TEST 20220314095728031322 NI
AE_TEST 20220314095823023148 NI
AE_TEST 20220314100932031323 NI
See also: