bw_create_decision_variant
Create and activate a decision variant with a condition formula and two branches (THEN/ELSE) for branching a Process Chain step.
Instructions
Create a DECISION process variant (a standalone TLOGO object) for use as a branch/decision step in a Process Chain, via the BW/4HANA Cockpit REST API. The variant holds two branches indexed by position: THEN/first (EVENTNO "01" by default, label "JA") and ELSE/second (EVENTNO "02", label "NEIN"). The formula is the branch condition (e.g. "GET_SEGMENT( ) = ' 3'"); it is evaluated for the THEN branch, the ELSE branch is its complement. The variant is created AND activated (activation is mandatory — an inactive variant is not selectable in the chain variant picker). After creation, reference the variant from a DECISION step in bw_create_process_chain / bw_update_process_chain (variant=), and branch its out-edges with sub_status "01"/"02". Package/transport: $TMP is fine for visibility and picker selection; pass a transportable package (NOT $TMP) only if you need to transport the variant. For a transportable package a transport_request is used (auto-selected when exactly one changeable request is available; pass it to disambiguate).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Decision variant technical name, uppercase (e.g. "VARIANT_NAME"). This is the name a chain DECISION step references. | |
| formula | Yes | Branch condition formula (BW decision formula syntax), e.g. "GET_SEGMENT( ) = ' 3'". | |
| package | No | Target package. Defaults to $TMP, which is fine for visibility/picker selection. Pass a transportable package only if the variant must be transportable. | |
| else_label | No | Label of the ELSE/second branch. Default "NEIN". | |
| then_label | No | Label of the THEN/first branch. Default "JA". | |
| description | Yes | Variant description / label. | |
| else_event_no | No | EVENTNO of the ELSE branch. Default "02". | |
| then_event_no | No | EVENTNO of the THEN branch (referenced by chain branch edges via sub_status). Default "01". | |
| transport_request | No | Transport request to record the new variant into. Used only for a transportable package (auto-selected when exactly one changeable request is available; pass to disambiguate). |