Create and change transformations
bw_write_transformationCreate and modify SAP BW/4HANA transformations: define field rules, add or remove routines, set runtime, and manage rule groups for data flow mappings.
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 |
|---|---|---|---|
| group | No | The rule group to rename, remove or change a rule in: its description or its id. [rule_group] | |
| action | No | What to do with the rule group. [rule_group] | |
| fields | No | Explicit complete set of target field names the END routine should write (e.g. ["FIELD_A", "FIELD_B"]). [set_routine_fields] | |
| source | No | The complete routine method block: "METHOD <NAME> BY DATABASE PROCEDURE … ENDMETHOD." for AMDP (HANA) routine… [set_expert_routine] | |
| target | No | For use_standard_rule: the target field whose rule follows the standard group again (e.g. "FIELD_NAME"). [rule_group] | |
| 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 field list of a global routine: the target fields the END routine writes (default), or with routine_type "start" the source fields the START routine r… 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. | update_settings: Change the settings of a Transformation that are not rules: its switches, the options of single target fields, and the fields the extraction is grouped by. Requires transformation_name. | rule_group: Add, rename or remove a rule group of a Transformation, or list its groups. Requires transformation_name, action. | |
| rule_type | No | Rule type to assign. [update_rule] | |
| transport | No | Defined per operation — bw_describe(tool: "bw_write_transformation", operation: "…") gives each definition. [8 of 9 operations] | |
| class_name | No | Optional override for the generated class name (e.g. "/BIC/<uuid>_M"). [set_expert_routine] | |
| conversion | No | Currency or unit conversion for a rule on a key figure with a currency or unit; goes with rule_type="direct",… [update_rule] | |
| rule_group | No | The rule group whose rule is changed, by its description or id; omitted: the standard group. [update_rule] | |
| aggregation | No | Aggregation type of the rule on a target key figure: "SUM" (summation), "MOV" (overwrite), "MIN", "MAX" or "N… [update_rule] | |
| description | No | The name of the new rule group (add), or the new name of the group (rename). [rule_group] | |
| method_name | No | Optional override for the routine method name (e.g. a field-routine method). [set_expert_routine] | |
| routine_type | No | Defined per operation — bw_describe(tool: "bw_write_transformation", operation: "…") gives each definition. [4 of 9 operations] | |
| source_field | No | Source field name in the source segment (e.g. "FIELD_NAME"). [update_rule] | |
| lookup_object | No | Name of the InfoObject or aDSO to read from. [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_options | No | Options of single target fields; only the properties given for a field change. [update_settings] | |
| lookup_time_value | No | For lookup_time_dependency "constant_date": the date as YYYYMMDD. [update_rule] | |
| target_infoobject | No | Target InfoObject name in the target segment (e.g. "IOBJ_NAME"). [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 | For rule_type="lookup": which source field feeds each key field of the lookup object (key field → source fiel… [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). [8 of 9 operations] | |
| lookup_error_constant | No | The value the target gets when the lookup finds nothing; needs lookup_error_handling "constant". [update_rule] | |
| lookup_error_handling | No | For rule_type="lookup" into a DataStore object: what happens when no record is found. [update_rule] | |
| semantic_group_fields | No | Complete list of source fields the extraction is grouped by (e.g. ["FIELD_A", "FIELD_B"]); [] removes the gro… [update_settings] | |
| source_object_subtype | No | InfoObject sub-type of the source. [create] | |
| target_object_subtype | No | InfoObject sub-type of the target. [create] | |
| initialize_null_values | No | Turn null values of the source into initial values. [update_settings] | |
| lookup_time_dependency | No | For rule_type="lookup" into an InfoObject with time-dependent attributes: the key date the attribute is read… [update_rule] | |
| enable_inverse_routines | No | Allow inverse routines for the routines of this transformation. [update_settings] | |
| 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] | |
| error_handling_in_routines | No | Allow routines to report erroneous records to the error handling of the DTP. [update_settings] | |
| allow_currency_unit_conversion | No | Currency and unit handling of the transformation. [update_settings] |