bw_add_process_chain_program
Add an ABAP program execution step to an existing Process Chain, positioning it before or after a specific step or appending it at the end. Supports optional selection variants and edge mode control.
Instructions
Add an "Execute ABAP Program" step (RSPC process type ABAP, "Programm ausführen") to an existing Process Chain (RSPC), via the BW/4HANA Cockpit REST API. Runs an ABAP report, optionally with a named SE38 selection variant. In-place edit: reads the current model, inserts the node + its INLINE process variant (the program call is stored inline in the chain — there is no separate variant object), and PUTs it back. Positioning: pass "before" to run the program ahead of an existing step (the target's incoming edges are rerouted through the new step, e.g. Start → PROGRAM → DTP); pass "after" to run it between a step and its successors; pass neither (optionally with predecessor) to append behind the strand end closest to the trigger. edge_mode "both" (default) adds an on-success and an on-error edge per new link; "success_only" adds only the on-success edge. Idempotent: if an ABAP step already calls the same program (and variant), it is skipped without writing. Only the synchronous/local/program call configuration is verified; keep the defaults. A 412 on the PUT means the ETag was stale (chain modified between read and write); the error reports this explicitly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Process chain technical name (e.g. "CHAIN_NAME"). Case-insensitive. | |
| after | No | Insert the program step AFTER this node — it runs between the target and its former successors. Mutually exclusive with "before". | |
| local | No | Call location. true (default) runs the program on this system (X_LOCAL). Only the default is verified. | |
| before | No | Insert the program step BEFORE this node (its DTP/variant name, or an aDSO held by an ADSOACT node). The target's incoming edges are rerouted through the new step. Mutually exclusive with "after". | |
| program | Yes | ABAP program / report to execute (e.g. "REPORT_NAME"). | |
| variant | No | Optional ABAP report (SE38) selection variant name (e.g. "VARIANT_NAME"). Omit to run the report without a variant. | |
| activate | No | If true, activate the chain immediately after the edit. Default false. | |
| edge_mode | No | "both" (default): add an on-success and an on-error edge per new link. "success_only": add only the on-success edge. | |
| description | No | Optional step description (cosmetic). | |
| predecessor | No | Used only when neither before nor after is given. Node to append behind (a DTP/variant name, an aDSO held by an ADSOACT node) or the literal "strand_end_auto" (default = terminal node closest to the trigger). | |
| synchronous | No | Call mode. true (default) runs the program synchronously (X_SYNCHRON). Only the default is verified. | |
| program_package | No | Optional package of the report (cosmetic value-help enrichment; the server re-derives it when omitted). | |
| transport_request | No | Optional transport request to record the change into. Only relevant when the chain is in a transportable package (not $TMP). If the chain is transportable and exactly one request is available, it is chosen automatically; pass this to disambiguate when several are available. Ignored for $TMP (local) chains. | |
| program_description | No | Optional report description (cosmetic). | |
| variant_description | No | Optional variant description (cosmetic). |