Repository navigation
Debugging
The sap-dev AI skill provides comprehensive ABAP debugging capabilities built on the native SAP ADT HTTP debugger engine (/sap/bc/adt/debugger/*).
It supports debugging across SAP GUI for Windows, SAP GUI for Java, HTTP / OData / Fiori APIs, RFC Function Modules, and Background Tasks.
| Tool Name | Lifecycle Stage | Description |
|---|---|---|
sap_debug_trace |
Recommended: One-shot debug trace. Sets a breakpoint, fires an asynchronous HTTP trigger, steps, evaluates SY & variables, and auto-detaches cleanly in a single call. | |
sap_debug_breakpoint |
Sets, lists, or clears this connection's owned project breakpoints. | |
sap_debug_attach |
Attaches to this debugger project's controlled HTTP trigger. Provide trigger_uri; use the connection user. | |
sap_debug_context |
Retrieves current call stack, local variables, and system fields for an active debug session. | |
sap_debug_step |
Executes single-step debugging commands (step into, step over, step return, or continue) in an active session. | |
sap_debug_evaluate |
Evaluates ABAP expressions, variables, or internal tables in an active debug session. | |
sap_debug_cleanup |
Terminates active SAP debugging sessions and deletes external breakpoints to prevent lock contention. |
For 95% of API, OData, or backend debugging needs, use sap_debug_trace. It executes the entire lifecycle (set breakpoint
{
"line": {
"class": "CL_ADT_MESSAGE_CLASS_API",
"line": 225
},
"trigger_request": {
"uri": "/sap/bc/adt/messageclass?corrNr=A4HK900151",
"method": "POST",
"body": "<?xml version=\"1.0\"...?>"
},
"watch_variables": ["LV_SUBRC", "LV_OBJECT_NAME"],
"auto_step_count": 2
}When deep multi-step exploration or variable drilling is required:
-
Set Breakpoint:
sap_debug_breakpoint(action: "set", line: {class: "CL_MY_CLASS", line: 42}) -
Attach Listener:
sap_debug_attach(trigger_uri: "/sap/opu/odata/sap/ZSERVICE_SRV/EntitySet", timeout_seconds: 30) -
Step & Inspect:
sap_debug_step(action: "stepOver")sap_debug_evaluate(parent_id: "LT_CUSTOMERS")
-
Cleanup:
sap_debug_cleanup()
When debugging interactive transactions, classic Dynpro screens, or reports executed in SAP GUI for Windows or SAP GUI for Java:
sequenceDiagram
autonumber
actor User as Developer (SAP GUI)
participant Bridge as sap-bridge (MCP)
participant SAP as SAP Backend (Kernel)
Note over User,SAP: One-Time Setup: Enable External Debugging in SE38 Settings
Bridge->>SAP: sap_debug_breakpoint(set line 12 for User)
Bridge->>SAP: sap_debug_attach(starts long-poll listener)
User->>SAP: Enter /H_REFRESH_EXT_BPS in GUI command field
SAP-->>User: "External breakpoints loaded, debugging activated"
User->>SAP: Press F8 (Execute ZREPORT)
SAP->>SAP: Work Process halts at Line 12
SAP->>Bridge: Notify debuggee session
Bridge->>SAP: Attach and fetch stack + variables
Bridge-->>User: Returns variable inspection to AI Agent
Bridge->>SAP: sap_debug_step(stepOver / detachDebugger)
SAP-->>User: Resumes execution in SAP GUI window
- Open transaction
SE38orSE80. - Navigate to menu: Utilities
$\rightarrow$ Settings$\rightarrow$ ABAP Editor$\rightarrow$ Debugging. - Under Debug External Requests (e.g. RFC, HTTP):
- Select the User radio button and verify your SAP username (e.g.,
YDZHENYEYEV). - Keep Current application server only unchecked.
- Select the User radio button and verify your SAP username (e.g.,
- Click the green checkmark (
$\checkmark$ ) to save.
Whenever new breakpoints are registered, load them into your active GUI session:
- In the SAP GUI command box (top-left), enter:
and press Enter. The status bar confirms: "External breakpoints loaded, debugging activated".
/H_REFRESH_EXT_BPS - To explicitly re-bind your user session:
/H_REACTIVATE_EXTD_DBG KIND=USER USER=<SY-UNAME>.
The agent can automate the entire listen
sap_debug_attach(
system_alias: "TD1-100",
trigger_program: "ZPUZZLE_1X",
timeout_seconds: 60
)sap-bridge will establish the listener, trigger GUI resynchronization in the attached session, and run SE38 $\rightarrow$ F8.
When executing transactions or clicking buttons manually:
-
Agent sets breakpoint:
sap_debug_breakpoint(action: "set", line: {program: "ZREPORT", line: 12}) -
Agent starts listener:
sap_debug_attach(timeout_seconds: 120) -
Developer runs GUI action: In SAP GUI, run
/H_REFRESH_EXT_BPSand press F8 (or click a dynpro button). - Agent inspects: Work process halts; the agent receives current line, stack trace, and variable values.
-
Agent steps or resumes:
sap_debug_step(action: "stepOver")-
sap_debug_step(action: "detachDebugger")releases control back to your SAP GUI window.
-
Cleanup:
sap_debug_cleanup()ensures zero lingering backend locks.