BW_SET_CONSTRAINT

Use the BW_SET_CONSTRAINT script element to define the automatic restart behavior for child processes of a process chain. You specify conditions and the action to take when those conditions are met — for example, querying a particular status and canceling the task if that status is found. The defined action applies to all child processes that match the defined conditions.

Syntax

BW_SET_CONSTRAINT [TYPE=...][,NAME=...],FIELD=...[,OPERATOR=...],VALUE=...,ACTION=...[,COUNT=...][,DELAY=...]

Parameters

Parameter Description Format Allowed Values Default Value
TYPE=
(Optional)

Step type of the child process.

You can use the * wildcard as a placeholder for any number of characters.

Script literal n.a. n.a.
NAME=
(Optional)

Name of the child process.

You can use the * and ? wildcard characters as placeholders.

Script literal n.a. n.a.
FIELD= The location in which the VALUE parameter is searched. Script literal
  • STATUS — Status of the child process
  • JOBLOG — Logs of the background job
  • PROCESSLOG — Logs of the child processes
n.a.
OPERATOR=
(Optional)
The operator for the condition Script literal
  • EQ — Equals (only valid with FIELD=STATUS)
  • NE — Does not equal (only valid with FIELD=STATUS)
  • CP — Contains pattern
  • NP — Does not contain pattern
EQ
VALUE=

The value to search for.

When checking child process status (FIELD=STATUS), use the following values from the RSPC_STATE domain definition in the SAP system:

  • X (Aborted),

  • R (Ended with errors),

  • G (Successfully completed),

  • F (Completed),

  • A (Active),

  • P (Planned),

  • S (Skipped at restart),

  • Q (Released),

  • Y (Ready), "" (Undefined)

Script literal n.a. n.a.
ACTION= The action to take for child processes that meet the condition Script literal
  • RESTART — Restarts the child process
  • ABEND — Cancels the child process
n.a.
COUNT=
(Optional)

Number of restarts to attempt for the child process.

Use only with ACTION=RESTART.

Number n.a. 1
DELAY=
(Optional)

Time interval in minutes to wait between restart attempts.

Use only with ACTION=RESTART.

Number n.a. 1

Important Considerations

To search in the process log or job log, you must enable log output for the activated or restarted process chain using the JOBLOGS or PROCESSLOGS parameters of BW_ACTIVATE_CHAIN and/or BW_RESTART_CHAIN.

Examples

The following example restarts all canceled ABAP child processes whose names start with RSM up to three times, with a 5-minute interval between attempts.

BW_SET_CONSTRAINT NAME="RSM*",VALUE="X",OPERATOR="EQ",ACTION="RESTART",TYPE="ABAP",DELAY="5",COUNT="3"

The following example cancels all ABAP child processes whose names start with RSM if their background job log contains the term error.

BW_SET_CONSTRAINT NAME="RSM*",VALUE="error",OPERATOR="CP",ACTION="ABEND",TYPE="ABAP",DELAY="5",COUNT="3",SOURCE="JOBLOG"