R3_GET_JOBS
Selects SAP jobs and lists the result in the activation report or a file.
Transaction: SM37
Interface: AE and Standard
Syntax
R3_GET_JOBS
NAME=...
[,JOBCOUNT=...]
[,GROUP=...]
[,USER=...]
[,START_D[ATE]=...]
[,START_T[IME]=...]
[,END_D[ATE]=...]
[,END_TIME=...]
[,NO_DATE=...]
[,WITH_PRED=...]
[,EVENT_ID=...]
[,EVENT_PARM=...]
[,PRELIM=...]
[,SCHEDUL=...]
[,READY=...]
[,RUNNING=...]
[,FINISHED=...]
[,ABORTED=...]
[,NOFOUND=...]
[,FILE=...]
Syntax |
Description/Format |
---|---|
NAME= |
Selection of one or more jobs by name. In connection with JOBCOUNT (SAP job number), a unique SAP job can be clearly
identified. |
Parameter |
Further selection criteria in the form of a keyword and an assignment. Non-specified parameters use default values. Formats are valid for the keyword assignment. |
JOBCOUNT= |
Number of the SAP job. In combination with the NAME (SAP job name), a unique SAP job can be clearly
identified. |
GROUP= |
Selection of jobs by groups (such as "xxx*"). Default value: "*" |
USER= |
Selection of jobs by users (such as "xxx*"). Default value: "*" |
START_D[ATE]= |
Planned start date for the job's execution. Date format: YYYYMMDD |
START_T[IME]= |
Planned start time for the job's execution. Time format: HHMMSS |
END_D[ATE]= |
Planned end date for the job's execution Date format: YYYYMMDD |
END_TIME= |
Planned end time for the job's execution Time format: HHMMSS |
NO_DATE= |
Jobs without start date. Allowed values: "" (default value) and "X" |
WITH_PRED= |
Jobs with start after predecessor. Allowed Values: "" (default value) and "X" |
EVENT_ID= |
Jobs that are linked to an event: Name of the event. |
EVENT_PARM= |
Jobs that are linked to an event: Parameter of the event. |
PRELIM= |
Jobs of status "Scheduled". Allowed Values: "" (default value) or "X" |
SCHEDUL= |
Jobs of status "Released". Allowed Values: "" (default value) or "X" |
READY= |
Jobs of status "Ready". Allowed values: "" (default value) or "X" |
RUNNING= |
Jobs with status "Active". Allowed values: "" (default value) or "X" |
FINISHED= |
Jobs of status "Finished". Allowed values: "" (default value) or "X" |
ABORTED= |
Jobs of status "Terminated". Allowed values: "" (default value) or "X" |
NOFOUND= |
Handling if no jobs are found by selection. Allowed values: "NORMAL" (default value) and "ABEND" "NORMAL" - Script execution continues,
the AE job ends normally. |
FILE= |
Name of the file in which the result (located SAP jobs) should be saved. The result of the selection is not output to the activation report if this parameter is used. |
ENCODING= |
This script element can be used to select background jobs in SAP. The selection criteria are assigned as parameters. The parameters correspond to the fields of the SAP Dictionary Structure BAPIXMJSEL. Use the dictionary or BAPI Browser for detailed information about the individual fields.
The result of the selection is either written to the activation report or a file. There is a line for each located SAP job. The structure of lines between the activation report and the file are different.
The file uses columns. The first line of the file contains information about the column size and contents. The individual lines correspond to these specifications. The first 33 characters contain the respective SAP job's name, the other 9 characters its number.
In the activation report, all information within a line is separated by a semicolon. Additionally, a timestamp and an AE message number is output to the beginning of the line.
Tip: You can use scripts in the Post Process page to analyze the result of the selection. Use the following script functions:
- PREP_PROCESS_REPORT
Analyze the activation report - PREP_PROCESS_FILE
Use if the selection result has been saved in a file
For more information, see Process Pages
Note: By default, created files are saved on the computer on which the agent is installed (such as R3_GET_JOB_SPOOL; FILE=).
Examples
The first example selects all scheduled SAP jobs that start with "REL".
R3_GET_JOBS NAME="REL*",PRELIM="X"
The result is written to the activation report and can look similar to the following lines:
20000922/134303.567 - U2004943 ;RELEASE;13450801
20000922/134303.567 - U2004943 ;RELEASE;13455501
20000922/134303.567 - U2004943 ;RELEASE;16221501
20000922/134303.567 - U2004943 ;RELEASE;16225101
20000922/134303.567 - U2004943 ;RELEASE;16234801
The second example selects all SAP jobs of the name "EU_REORG" and the status "Finished". The selection result is saved in a file.
R3_GET_JOBS NAME='EU_REORG',FINISHED='X',FILE='jobs.txt'
The first lines of the file could look as shown below:
COL=LENGTH,LENGTH_TAB='33=JOBNAME,9=JOBCOUNT'
EU_REORG 01404301
EU_REORG 01405401
See also:
seealso