bw_write_query
Create or modify SAP BW queries and their reusable components—layouts, filters, key figures, variables, structures, cells, exceptions, settings, and role assignments.
Instructions
Create or change a query and its reusable components: layout, filter, key figures, characteristics, cells, exceptions, settings, restricted and calculated key figures, structures, variables, role assignments. The operation enum lists every operation with what it requires; bw_describe(tool: "bw_write_query", operation: "…") gives the complete parameter definition of one.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"operation": "<operation>"
},
"name": "bw_write_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_variable, update_variable] | |
| action | No | "add" to publish, "remove" to unpublish. [set_roles] | |
| formula | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_ckf, update_ckf] | |
| members | No | Members, in display order. [create_structure] | |
| package | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [4 of 17 operations] | |
| currency | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_variable, update_variable] | |
| decimals | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_ckf, update_ckf] | |
| reusable | No | Whether the variable can be reused in multiple queries. [create_variable] | |
| copy_from | No | Technical name of an existing query to copy (e.g. [create] | |
| dimension | No | Formula variables only: what the number stands for. [create_variable] | |
| info_area | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_rkf, create_ckf, create_structure] | |
| iobj_name | No | g. [create_variable] | |
| operation | Yes | Operation — one of: create: Create a new BW Query (TLOGO ELEM) on an InfoProvider in package $TMP. Requires query_name. | update_layout: Modify an existing BW Query layout: add or remove characteristics in the rows, columns, or free-characteristics area, and add or remove references to reusable… Requires query_name, operations. | update_filter: Modify an existing BW Query filter. Requires query_name, operations. | update_key_figures: Manage the key figure structure and the characteristic structure of an existing BW Query: add basic key figures, add references to reusable CKFs/RKFs (with opt… Requires query_name, operations. | update_characteristic: Set the display and access properties of the characteristics in an existing BW Query - the per-characteristic settings of the rows, columns, and free-character… Requires query_name, characteristics. | update_cells: Manage the cell definitions of an existing BW Query that has two structures (one on each axis): add reference cells (make the value at an intersection of a mem… Requires query_name, operations. | update_exceptions: Manage the exceptions (alert levels that colour data cells) of an existing BW Query: add exceptions with thresholds per alert level, change them, and remove th… Requires query_name, operations. | update_settings: Change query-level display and behaviour settings of an existing BW Query (description, zero suppression, result position, sign presentation, zero presentation… Requires query_name. | create_rkf: Create one reusable Restricted Key Figure (RKF, TLOGO ELEM) on an InfoProvider. Requires provider_name, technical_name, description, base_key_figure, restrictions. | update_rkf: Change a reusable Restricted Key Figure in place: description, base key figure and/or restrictions. Requires component_name. | create_ckf: Create a reusable Calculated Key Figure (CKF) on an InfoProvider. Requires provider_name, technical_name, description, formula. | update_ckf: Change a reusable Calculated Key Figure. Requires component_name. | create_structure: Create a reusable key figure structure on an InfoProvider — the object reporting queries embed as an axis, so that one definition drives all of them. Requires provider_name, technical_name, description. | update_structure: Change a reusable structure: add, remove or re-configure members. Requires component_name, operations. | create_variable: Create a reusable BW Variable, created active and consistent. Requires variable_name, description. | update_variable: Change a reusable BW Variable in place: description, input readiness, input type (optional / mandatory), selection type and processing type, and on a formula v… Requires variable_name. | set_roles: Publish or unpublish a BW query in a role or folder. Requires query_name, action, target_name, target_type. | |
| structure | No | Structure the operations address (default "key_figures"). [update_key_figures] | |
| transport | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [8 of 17 operations] | |
| input_type | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_variable, update_variable] | |
| operations | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [7 of 17 operations] | |
| query_name | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [9 of 17 operations] | |
| represents | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_variable, update_variable] | |
| description | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [10 of 17 operations] | |
| target_name | No | For target_type "role": the name attribute of the ROLE node (e.g. [set_roles] | |
| target_type | No | "role" to assign at role level, "folder" to assign into a specific subfolder. [set_roles] | |
| infoprovider | No | Technical name of the InfoProvider the query is built on (e.g. [create] | |
| offset_start | No | Text variables by replacement path only: first character of the value shown, counted from 0 (default 0). [create_variable] | |
| restrictions | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_rkf, update_rkf] | |
| default_value | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_variable, update_variable] | |
| offset_length | No | Text variables by replacement path only: number of characters shown; 0 (default) shows the rest. [create_variable] | |
| provider_name | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_rkf, create_ckf, create_structure] | |
| variable_name | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_variable, update_variable] | |
| variable_type | No | What the variable stands for: a characteristic value (default), a whole hierarchy, hierarchy nodes, a number… [create_variable] | |
| component_name | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [update_rkf, update_ckf, update_structure] | |
| document_links | No | Document link visibility. [update_settings] | |
| technical_name | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_rkf, create_ckf, create_structure] | |
| base_key_figure | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_rkf, update_rkf] | |
| characteristics | No | One entry per characteristic, or a single entry with infoobject "*" for all of them. [update_characteristic] | |
| master_language | No | Language code for the descriptions (e.g. [create_variable] | |
| processing_type | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_variable, update_variable] | |
| ready_for_input | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_variable, update_variable] | |
| parent_role_name | No | Required when target_type is "folder". [set_roles] | |
| replacement_type | No | Text variables by replacement path only: what the text shows of the characteristic value — the key (default),… [create_variable] | |
| structure_target | No | Container for the key figure structure when it is created by the first add operation (default "columns"), and… [update_key_figures] | |
| adjust_formatting | No | Adjust formatting. [update_settings] | |
| development_class | No | Package name (e.g. [create_variable] | |
| sign_presentation | No | Sign presentation (e.g. [update_settings] | |
| transport_request | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [7 of 17 operations] | |
| result_position_top | No | Place the result row on top. [update_settings] | |
| show_scaling_factor | No | Show the scaling factor. [update_settings] | |
| replacement_interval | No | Text variables by replacement path only: for a range, the lower bound (default), the upper bound, or the diff… [create_variable] | |
| replacement_variable | No | g. [create_variable] | |
| result_position_left | No | Place the result column on the left. [update_settings] | |
| used_as_infoprovider | No | Release the query as an InfoProvider. [update_settings] | |
| exception_aggregation | No | Defined per operation — bw_describe(tool: "bw_write_query", operation: "…") gives each definition. [create_ckf, update_ckf] | |
| zero_suppression_rows | No | Suppress zero-value rows. [update_settings] | |
| hierarchy_display_rows | No | Universal display hierarchy for rows. [update_settings] | |
| zero_presentation_kind | No | Zero presentation kind (e.g. [update_settings] | |
| zero_suppression_columns | No | Suppress zero-value columns. [update_settings] | |
| hierarchy_display_columns | No | Universal display hierarchy for columns. [update_settings] | |
| suppress_repeated_key_values | No | Suppress repeated key values. [update_settings] | |
| zero_presentation_custom_value | No | Custom value shown for zeros. [update_settings] |