bw_update_ckf
Modify a reusable Calculated Key Figure by replacing its formula or appending/removing operands. Changes are applied in a single atomic save to avoid partial edits.
Instructions
Change a reusable Calculated Key Figure. Two call forms: pass "formula" to replace the whole expression, or "operations" for targeted edits that leave the rest of the formula untouched — the usual case being "add another summand to a sum" without having to know or rebuild the existing formula. All operations are applied to one document and written in a single save, so a rejected operation leaves the stored formula unchanged rather than half edited.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| formula | No | Replacement formula tree (mutually exclusive with "operations"). Formula tree. A node is one of: {"type":"operator","code":"+","operands":[...]} (codes as in the BW formula editor: + - * / , NDIV0, IF, MAX, %A, …); {"type":"component","component_name":"..."} for a reusable CKF/RKF; {"type":"key_figure","name":"..."} for a basic key figure InfoObject; {"type":"constant","value":100}. Operand counts are checked against the operator catalog before anything is written. | |
| decimals | No | Number of decimal places (0-9). | |
| operations | No | Targeted edits on the existing formula, applied in order. | |
| description | No | New description. | |
| component_name | Yes | Technical name of the CKF. | |
| transport_request | No | Transport request to record the change in. | |
| exception_aggregation | No | Exception aggregation of the CKF itself, e.g. { "type": "SUM", "reference_characteristic": "IOBJ_NAME" }, or false (null is accepted too) to return to standard aggregation. Independent of "formula" / "operations": the formula stays as it is. Takes back unchanged what bw_get_ckf reports in exception_aggregation. |