BW_ACTIVATE_CHAIN
Use the BW_ACTIVATE_CHAIN script element to start a process chain, monitor processing, and store the logs in the activation report. The script element lets you determine the start conditions. If the process chain does not start immediately, but only following an event or at a certain time, these start conditions are logged. When the process chain starts, it is monitored until it ends. The process chain log is always stored in the activation report. The script element also lets you store individual process logs or process background job logs, and trigger repeated attempts for the process chain to continue in case of interruption.
Transaction: RSA1
SAP BW Version: 3.0B and later with Patch SAPKW30B11
Syntax
BW_ACTIVATE_CHAIN
ID=...
[,NOFOUND=...]
[,ERROR=...]
[,PROCESSLOGS=...]
[,RESTART=...]
[,JOBLOGS=...]
[,LONGTEXT=...]
[,REPLICATE=...]
[,STATUSRETRY=...]
[,SCHEDULE=...]
[,SYNCHRONOUS=...]
[,GET_SPOOL=...]
[,COLLECTLOGS=...]
Syntax |
Description / Format |
---|---|
ID= |
Technical designation of the process chain |
NOFOUND= |
Handling if a process chain cannot be found.
|
ERROR= |
Handling if a process chain ends abnormally
Tip: You can use this parameter in order to restart process chains or their child processes. The advantage is that the job does not end which would include that processing continues in a parent (such as a workflow). |
PROCESSLOGS= |
Output of a process chain's individual process logs
|
RESTART= |
Number of attempts for continuation of an interrupted process chain |
JOBLOGS= |
Output of the process background job log Allowed values:
|
LONGTEXT= |
Output of a log message's long text (diagnostics text) Format: script literal Allowed values:
|
REPLICATE= |
Handling of the children of a process chain Format of the value: script literal Allowed values:
|
STATUSRETRY= |
Number or repeated status checks Default value: 0 Note: Due to a special SAP behavior, process chains can show the status "ended" for a short time but continue afterward. The agent reports this process chain as ended if it has retrieved its status exactly at this point in time. Use the parameter STATUSRETRY= to prevent that the end of a process chain is reported too early. You can determine the number of repeated status checks with this parameter. Only after n repetitions, the Automation Engine will be informed that the process has ended. |
SCHEDULE= |
New scheduling of process chains Allowed values:
|
SYNCHRONOUS= |
Executes process chains synchronously. Allowed values:
|
GET_SPOOL= |
Requests the spool list of the started job.
Allowed values:
|
COLLECTLOGS= |
Writes the reports of the activated process chain's child processes to the job report. The reports of replicated child processes are by default available in the job report AND the task of the child process. Therefore, this information is redundant in the job and you can decide not to assume this information here. Allowed values: YES (default) or NO
Note: The reports of the child processes are not available if you specify NO in the REPLICATE and COLLECTLOGS parameters . |
Status Check
The Automation Engine presumes that the technical status that is submitted when the function status check is called is a "final status". The Interface Repository gives the following description:
The parameter TECHSTATUS is the request's technical status. It always contains one of the following values:
- G
Green (request handling successful) - Y
Yellow (request is being processed) - R
Red (request incorrect or canceled)
Obviously, these states are not "final states". A status can change to "red" for a short time and then to "yellow" or "green" after a while. AE accounts for this fact. For status checks, a time delay can be activated so that it can be checked n times if the status "red" actually remains in this status, for example. The INI file of the SAP Agent contains the parameters maxruntime= and repeat_check= [SAP_BW]) for this.
Another function is available which checks the states of process chains. It supplies the following values:
- "R" - cancel
- "G" - normal end
- "F" - normal end
- "A" - continue checking
- "X" - cancel
- "P" - continue checking
- "S" - cancel (but only after the process chain has been restarted)
- "Q" - continue checking
- "Y" - continue checking
- " " - continue checking
AE then converts these states into return codes:
Return code |
Status |
SAP status |
---|---|---|
0 |
ENDED_OK |
G or F |
4 |
ENDED_NOT_OK |
R |
8 |
ENDED_NOT_OK |
X |
12 |
ENDED_NOT_OK |
S |
Examples
This example activates a process chain which has previously been queried by a user. The values for the relevant script element's parameters also result from this query. These values 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='<#'