Sap Se38 Edit
sap_se38_editReplace the full source of an existing ABAP report in SE38, run a syntax check, and activate it; automatically reverts changes if validation or activation fails.
Instructions
Edit an existing ABAP report in SE38. 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 reports. To create new reports, use abapGit.
Workflow: Read current source with sap_read_se38_source first, 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": {
"program_name": "<program_name>",
"new_source": "<new_source>"
},
"name": "sap_se38_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. | |
| program_name | Yes | Name of the ABAP report (e.g., 'ZTEST_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 report was successfully activated | |
| program_name | Yes | Name of the ABAP report 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 source code before editing (for reference/undo) | |
| check_messages | No | Messages from syntax check (Ctrl+F2) |