bw_add_process_chain_plswitch
Inserts load/planning mode switch steps into an existing BW Process Chain for planning-enabled aDSOs, optionally bracketing a load step, to control when loads run.
Instructions
Add planning mode switch steps for planning-enabled aDSOs to an existing Process Chain (RSPC), via the BW/4HANA Cockpit REST API: PLSWITCHL switches the aDSOs to load mode, PLSWITCHP back to planning mode. A planning-enabled aDSO accepts no loads in planning mode, so a chain that loads it typically runs switch to load mode → (deletion) → DTP → switch to planning mode. In-place edit: reads the current model, inserts the node(s) with their INLINE process variant, and PUTs it back. mode "load" or "plan" adds one step and needs exactly one of before, after or predecessor — there is no automatic append point, because a switch beside the chain start would switch at the wrong moment. mode "bracket" encloses an existing step ("around", usually the DTP): switch to load mode ahead of it, switch to planning mode behind it, in one save. Only aDSOs offered by the cockpit value help for this step are accepted (active and planning-enabled); others are refused before anything is written. edge_mode "both" (default) adds an on-success and an on-error edge per new link, so the switch back to planning mode also runs when the load fails; "success_only" adds only the on-success edge. Idempotent: a step of the same type for the same set of aDSOs is not added again. Existing switch steps can be referenced elsewhere as "PLSWITCHL/ADSO_NAME" or "PLSWITCHP/ADSO_NAME".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | "load": add a switch to load mode (PLSWITCHL). "plan": add a switch to planning mode (PLSWITCHP). "bracket": add both around the step named in "around". | |
| name | Yes | Process chain technical name (e.g. "CHAIN_NAME"). Case-insensitive. | |
| after | No | mode "load"/"plan": insert the step AFTER this node — it runs between the target and its former successors. | |
| around | No | mode "bracket" only: the step to enclose (usually the DTP that loads the aDSO). | |
| before | No | mode "load"/"plan": insert the step BEFORE this node (a DTP/variant name, an aDSO held by an ADSOACT node, or "#<index>"). The target's incoming edges are rerouted through the new step. | |
| 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. | |
| datastores | Yes | Planning-enabled aDSOs the step switches (e.g. ["ADSO_NAME"]). One step can switch several. | |
| description | No | Optional step description (cosmetic, max. 60 characters). Defaults to the mode and the aDSO names. | |
| predecessor | No | mode "load"/"plan": append the step behind this node without rerouting the node's other successors. | |
| 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. |