Repository navigation
Debugging
Use the native SAP ADT debugger tools for Execution-Guard-authorized scratchpad routines and controlled HTTP requests as the connected SAP user. The runtime binds the trigger, external breakpoints, and listener to that connection's private debugger project. Include the initialized workspace's absolute workspace_dir and the selected system_alias in every call.
| Tool Name | Description |
|---|---|
sap_debug_trace |
One-shot debug trace with an Execution-Guard-authorized scratchpad or controlled HTTP trigger. Captures stack and variables, optionally steps, and cleans up owned debugger resources. |
sap_debug_breakpoint |
Sets, lists, or clears this connection's owned project breakpoints. |
sap_debug_attach |
Attaches to an Execution-Guard-authorized scratchpad or controlled HTTP trigger in this connection's debugger project. Supply scratchpad_params or trigger_uri. |
sap_debug_context |
Retrieves current call stack, local variables, and system fields for an active debug session. |
sap_debug_step |
Steps or continues an active session. Successful terminal actions retire the session and return status: "session_closed". |
sap_debug_evaluate |
Evaluates ABAP expressions, variables, or internal tables in an active debug session. |
sap_debug_cleanup |
Cleans up selected owned debugger sessions and external breakpoints; complete-scope cleanup also retires the owned listener. |
Fetch fresh active source with sap_fetch(for_editing: false) before choosing a breakpoint. For scratchpad routines, request aspect: "implementations" on ZCL_SAP_DEV_RPC_EXT and use an executable line from the returned local implementations source.
Select exactly one trigger form:
-
scratchpad_paramsinvokes the activatedEXECUTE_SCRATCHPADroutine through the same Execution Guard assap_execute_ext_method. The runtime resolves the connection's configured service path. Bundled actions areHELLO_WORLDandCALC, using exact uppercase names. - For another authorized HTTP reproduction, supply
trigger_requesttosap_debug_trace, ortrigger_uriand optional HTTP fields tosap_debug_attach. The reproduced operation retains its API and object guard requirements; authorize any business-data effects as part of that reproduction.
Omit user or supply the connected SAP username. A different user returns DEBUGGER_PROJECT_USER_UNSUPPORTED. A missing trigger returns DEBUGGER_CONTROLLED_TRIGGER_REQUIRED. Direct RPC URLs return FORBIDDEN_RPC; use the guarded scratchpad trigger for those routines.
Confirm the connected tool schema exposes scratchpad_params before using that form. A missing parameter calls for a complete skill/runtime update and the matching bundled ABAP reference upgrade through Upgrade. Resolve DEBUGGER_PROJECT_LISTENER_UNSUPPORTED against the selected backend before retrying. Preserve other developers' listeners and debugging settings.
Supply one breakpoint target (line, statement, exception, or message), one trigger, and optional watch variables. This example traces the guarded scratchpad; replace the URI and line with the executable location from the fresh implementations fetch:
{
"line": {
"uri": "/sap/bc/adt/oo/classes/zcl_sap_dev_rpc_ext/includes/implementations",
"line": 42
},
"scratchpad_params": {"action": "HELLO_WORLD", "name": "World"},
"watch_variables": ["SY-SUBRC"],
"auto_step_count": 2
}Inspect structured status and cleanup_applied after the call. Captured variables establish the observed execution state; cleanup needs its own confirmed result. For CALC, supply optional amount and rate; omitted or zero inputs use 100 and 19, and total is their product.
- Set a breakpoint with
sap_debug_breakpoint(action: "set"), using one fresh-source line, statement, exception, or message target. - Call
sap_debug_attachwithscratchpad_paramsor an authorized controlled HTTPtrigger_uriand a boundedtimeout_seconds. Retain the returnedsession_id. - Inspect with
sap_debug_contextandsap_debug_evaluate. Step withstepInto,stepOver,stepReturn, orstepContinue. SuccessfuldetachDebuggerandterminateDebuggeeactions returnstatus: "session_closed"after retiring the selected session. - Run
sap_debug_cleanupfor the intended owned resources and inspect its confirmed outcomes.
sap_debug_breakpoint(action: "list") returns the connection's owned inventory. provenance: "sap_dev_owner" and completeness: "owner_only" identify that scope. An empty owned inventory establishes only the absence of acknowledged resources in that scope.
Cleanup with session_id selects that session; breakpoint_uri selects owned breakpoints at that exact URI. Both selectors combine those targets. Omitting both selects the connection's complete owned scope and retires its listener. Selective cleanup preserves unselected sessions, breakpoints, and the listener. Preserve recovery evidence and obtain developer assistance when confirmation remains unresolved or native cleanup fails.
For a GUI-, RFC-, or batch-only reproduction, have the developer perform the investigation in their SAP debugger or capture source, dump, and diagnostic evidence for analysis. The MCP debugger accepts the supported scratchpad and controlled HTTP triggers above. GUI/program triggers return DEBUGGER_GUI_PROJECT_BINDING_UNSUPPORTED; attachment requires a supported trigger.
Use Diagnostics for developer-captured traces and disconnected-system evidence, and SAP GUI Automation for guarded GUI navigation and inspection. Preserve the developer's active debugger and existing settings.