Sap Se24 Edit
sap_se24_editReplace an existing ABAP class method's source in SE24, then run syntax check and activate; automatically reverts changes if check or activation fails.
Instructions
Edit an existing class method in SE24 (Class Builder). If sap-adt is available, prefer its patch_source or set_source_from_file tools — faster, no GUI needed.
Replaces the method's source code, runs syntax check (Ctrl+F2), and activates (Ctrl+F3). Auto-reverts if check or activation fails.
Important: Only for EXISTING classes and methods. To create new ones, use abapGit.
Workflow: Read current class with sap_se24_lookup first to see methods, then call this tool with the full new method source.
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": {
"class_name": "<class_name>",
"method_name": "<method_name>",
"new_source": "<new_source>"
},
"name": "sap_se24_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | No | Session ID (e.g., "s1", "s2"). None uses primary session. | |
| agent_id | No | Agent identifier for binding check. Optional. | |
| class_name | Yes | Name of the class (e.g., 'ZCL_TEST_MCP_EDIT'). | |
| new_source | Yes | Complete new ABAP method source code to replace the current code. | |
| method_name | Yes | Name of the method to edit (e.g., 'DO_SOMETHING'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message if success=False | |
| popup | No | Present when a popup dialog is active on screen | |
| success | No | Whether the operation succeeded | |
| activated | No | Whether the class was successfully activated | |
| class_name | Yes | Name of the class that was edited | |
| method_name | Yes | Name of the method that was edited | |
| active_window | No | Which window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open. | |
| backup_source | Yes | Original method source code before editing (for reference/undo) | |
| check_messages | No | Messages from syntax check and activation |