Sap Se37 Edit
sap_se37_editEdit an existing ABAP function module in SE37 by replacing its full source, running syntax checks, and activating it; changes revert automatically if checks fail.
Instructions
Edit an existing ABAP function module in SE37. If sap-adt is available, prefer its patch_source or set_source_from_file tools — faster, no GUI needed.
Replaces the entire source code, runs syntax check (Ctrl+F2), and activates (Ctrl+F3). Auto-reverts if check or activation fails.
Important: Only for EXISTING function modules. To create new ones, use abapGit.
Workflow: Read current source with sap_se37_lookup first (check the Quelltext/Source Code tab), modify it, then call this tool with the full new 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": {
"function_module": "<function_module>",
"new_source": "<new_source>"
},
"name": "sap_se37_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. | |
| new_source | Yes | Complete new ABAP source code to replace the current code. | |
| function_module | Yes | Name of the function module (e.g., 'Z_TEST_MCP_EDIT'). |
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 function module was successfully activated | |
| 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 source code before editing (for reference/undo) | |
| check_messages | No | Messages from syntax check and activation | |
| function_module | Yes | Name of the function module that was edited |