bw_write_transformation
Create and modify SAP BW/4HANA transformations by defining field rules, managing Start/End/Expert routines, and setting HANA or ABAP runtime.
Instructions
Create a transformation, change the rule of a field, and set or remove its routines and runtime. The operation enum lists every operation with what it requires; bw_describe(tool: "bw_write_transformation", 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_transformation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Explicit complete set of target field names the END routine should write (e.g. [set_routine_fields] | |
| source | No | " for ABAP routin… Full definition: bw_describe(tool: "bw_write_transformation", operation: "set_expert_routi… [set_expert_routine] | |
| formula | No | Formula expression for rule_type="formula" (required). [update_rule] | |
| package | No | Development package. [create] | |
| runtime | No | "hana" sets HANARuntime="true", "abap" sets HANARuntime="false". [set_runtime] | |
| activate | No | Activate the transformation in the same call (default false). [create] | |
| operation | Yes | Operation — one of: create: Create a new Transformation between two BW objects (aDSO, DataSource, InfoSource, etc.). Requires source_object_type, source_object_name, target_object_type, target_object_name. | update_rule: Map a source field to a target field in a Transformation, or change the type of the rule of a field — direct, time conversion, routine, formula, constant, look… Requires transformation_name, target_infoobject. | set_routine: Add a Start, End, or Expert routine to a Transformation. Requires transformation_name, routine_type. | set_expert_routine: Write the CODE of an existing Start/End/Expert routine into the Transformation MASTER so it survives TLOGO regeneration — a full bw_activate(trfn) AND a transp… Requires transformation_name. | set_routine_fields: Edit the list of target fields the global END routine writes ("Felder setzen" in SAP GUI). Requires transformation_name. | delete_routine: Remove a Start, End, or Expert routine from a Transformation. Requires transformation_name, routine_type. | set_runtime: Switch a Transformation between HANA and ABAP runtime. Requires transformation_name, runtime. | |
| rule_type | No | Rule type to assign. [update_rule] | |
| transport | No | Defined per operation — bw_describe(tool: "bw_write_transformation", operation: "…") gives each definition. [6 of 7 operations] | |
| class_name | No | Optional override for the generated class name (e.g. [set_expert_routine] | |
| conversion | No | Currency or unit conversion for a direct rule on a key figure with a currency or unit (rule_type="direct"). [update_rule] | |
| aggregation | No | Aggregation type of the rule on a target key figure: "SUM" (summation), "MOV" (overwrite), "MIN", "MAX" or "N… [update_rule] | |
| method_name | No | Optional override for the routine method name (e.g. [set_expert_routine] | |
| routine_type | No | Defined per operation — bw_describe(tool: "bw_write_transformation", operation: "…") gives each definition. [set_routine, set_expert_routine, delete_routine] | |
| source_field | No | g. [update_rule] | |
| lookup_object | No | Name of the InfoObject or aDSO to read from (Nachlese-Objekt). [update_rule] | |
| source_system | No | Source system name. [create] | |
| constant_value | No | Constant value for rule_type="constant" (required). [update_rule] | |
| exclude_fields | No | Target fields to exclude from the END routine — all other target fields are written. [set_routine_fields] | |
| target_infoobject | No | Target InfoObject name in the target segment (e.g. [update_rule] | |
| unit_source_field | No | Source unit/currency field for a COMBINED key-figure + unit/currency direct rule (rule_type="direct"). [update_rule] | |
| lookup_key_mapping | No | g. [update_rule] | |
| lookup_object_type | No | Type of the lookup object. [update_rule] | |
| source_object_name | No | Technical name of the source object. [create] | |
| source_object_type | No | Source object type. [create] | |
| target_object_name | No | Technical name of the target object. [create] | |
| target_object_type | No | Target object type. [create] | |
| transformation_name | No | Transformation name (UUID-like key). [6 of 7 operations] | |
| source_object_subtype | No | InfoObject sub-type of the source. [create] | |
| target_object_subtype | No | InfoObject sub-type of the target. [create] | |
| additional_source_fields | No | Additional source fields for rule_type="formula" and "routine". [update_rule] | |
| copy_from_transformation | No | Technical name of an existing Transformation to copy rules from. [create] |