BW_ACTIVATE_CHAIN
Use the BW_ACTIVATE_CHAIN script element to start a process chain, monitor its processing, and store the logs in the activation report. You can specify various start conditions. If the process chain does not start immediately — for example, because it waits for an event or a scheduled time — those conditions are logged. Once the process chain starts, it is monitored until it ends. You can also store individual process logs or background job logs, and trigger repeated restart attempts if the process chain is interrupted.
Transaction: RSA1
Syntax
BW_ACTIVATE_CHAIN ID=...[,NOFOUND=...][,ERROR=...][,PROCESSLOGS=...][,RESTART=...][,JOBLOGS=...][,LONGTEXT=...][,REPLICATE=...][,STATUSRETRY=...][,SCHEDULE=...][,SYNCHRONOUS=...][,GET_SPOOL=...][,COLLECTLOGS=...]
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| ID= | Technical name of the process chain | Script literal | n.a. | n.a. |
| NOFOUND=
(Optional) |
Handling if the process chain cannot be found | Script literal |
|
NORMAL |
| ERROR=
(Optional) |
Handling if the process chain ends abnormally. This parameter is useful for restarting process chains or their child processes; the job does not end, so processing in a parent object such as a workflow can continue. | Script literal |
|
ABEND |
| PROCESSLOGS=
(Optional) |
Controls output of the individual process logs of the process chain | Script literal |
|
YES |
| RESTART=
(Optional) |
Number of attempts to continue an interrupted process chain | Integer | n.a. | 0 |
| JOBLOGS=
(Optional) |
Controls output of the process logs of background jobs | Script literal |
|
YES |
| LONGTEXT=
(Optional) |
Controls output of the long text (diagnostics text) of log messages | Script literal |
|
ERROR |
| REPLICATE=
(Optional) |
Controls replication of child processes of the process chain in the AE system | Script literal |
|
NO |
| STATUSRETRY=
(Optional) |
Number of repeated status checks before Automation Engine is informed that a process has ended. Due to a specific SAP behavior, process chains can briefly show the status "ended" and then continue. Use this parameter to avoid the agent reporting the end of the process chain prematurely. | Number | n.a. | 0 |
| SCHEDULE=
(Optional) |
Controls whether the process chain is rescheduled before activation. Setting this to NO accelerates the start of the process chain. | Script literal |
|
YES |
| SYNCHRONOUS=
(Optional) |
Controls whether the process chain is executed synchronously to start processing immediately | Script literal |
|
NO |
| GET_SPOOL=
(Optional) |
Controls whether the spool list of the started job is requested. When YES, the spool list is stored as a text file in the directory defined by the Download_dir= parameter ([GLOBAL] section) of the SAP Agent INI file. The filename is structured as follows: <SAP job count>_<step number>_<spool number>.txt. The file is also registered as job output in the AE job. For more information, see Agent SAP and Registered Job Output. | Script literal |
|
NO |
| COLLECTLOGS=
(Optional) |
Controls whether reports of activated child processes are written to the job report. By default, reports of replicated child processes are available in both the job report and the child process task. Use NO to avoid storing this information twice. | n.a. |
|
YES |
Important Considerations
The reports of child processes are not available if you specify NO for both the REPLICATE and COLLECTLOGS parameters.
Status Check
The Automation Engine expects a final technical status when the agent verifies the process chain status. The Interface Repository defines the TECHSTATUS parameter as always containing one of the following values:
-
G — Green (request handling successful)
-
Y — Yellow (request is being processed)
-
R — Red (request incorrect or canceled)
These are not final states; a status can change to red briefly and then return to yellow or green. AE accounts for this. You can configure a time delay for status checks to verify n times whether a red status actually persists. The SAP Agent INI file contains the maxruntime= and repeat_check= parameters in its [SAP_BW] section for this purpose.
A separate function checks the states of process chains and returns the following values:
-
R — Cancel
-
G — Normal end
-
F — Normal end
-
A — Continue checking
-
X — Cancel
-
P — Continue checking
-
S — Cancel after the process chain has been restarted
-
Q — Continue checking
-
Y — Continue checking
-
" " — Continue checking
The AE system converts these states into the following return codes:
| Return Value | Condition |
|---|---|
| 0 | Status: ENDED_OK — SAP status: G or F |
| 4 | Status: ENDED_NOT_OK — SAP status: R |
| 8 | Status: ENDED_NOT_OK — SAP status: X |
| 12 | Status: ENDED_NOT_OK — SAP status: S |
Examples
The following example activates a process chain whose parameters were queried from the user. The query results are assigned to the script element as script variables.
: BEGINREAD
: READ &CHAIN#, "ZTEST,ZSBB1,ZSBB2", 'Process chain', 'ZTEST',M
: READ &ERROR#, "IGNORE,ABEND", 'ERROR=', 'ABEND'
: READ &NOFOUND#, "NORMAL,ABEND", 'NOFOUND=', 'NORMAL'
: READ <#, "YES,NO,ERROR", 'LONGTEXT=', 'YES'
: ENDREAD
BW_ACTIVATE_CHAIN ID='&CHAIN#',ERROR='&ERROR#',NOFOUND='&NOFOUND#',LONGTEXT='<#'