Debug ABAP on the connected system — set a narrowly conditioned breakpoint, catch the request (triggered from another session, or started by the debugger itself), inspect the call stack and variables, step, and always clean up; or analyse a short dump post-mortem. Uses mcp-abap-adt's Debug* tools (19.x) or vibing-steampunk's debugger. Built for shared systems where many people run as the same SAP user. Use when the user asks to debug, set a breakpoint, see what a variable holds at runtime, st...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Abap Debug?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/coveles-abap-debug)
---
name: abap-debug
description: Debug ABAP on the connected system — set a narrowly conditioned breakpoint, catch the request (triggered from another session, or started by the debugger itself), inspect the call stack and variables, step, and always clean up; or analyse a short dump post-mortem. Uses mcp-abap-adt's Debug* tools (19.x) or vibing-steampunk's debugger. Built for shared systems where many people run as the same SAP user. Use when the user asks to debug, set a breakpoint, see what a variable holds at runtime, step through code, or investigate a runtime error / short dump.
---
# abap-debug — breakpoints, stepping and dumps
Before the first tool call, read `../../reference/tools.md` (debugger tools + known issues) and
`../../reference/guardrails.md`.
**Which debugger.** Use the first one the session has:
1. **mcp-abap-adt** (19.x; 17.2–18.x with `--exposition=…,debug`): tools `DebugStartListener`,
`DebugWait`, `DebugGetVariables`, `DebugStep`, `DebugStop`, … — a session behind a `state_handle`.
2. **vibing-steampunk (vsp)**: tools `SetBreakpoint`, `DebuggerListen`, `DebuggerStep`, … — see the
vsp section at the end.
Without either, say so and offer a post-mortem analysis of a short dump instead.
## How external debugging works (explain this to the user once)
A breakpoint set here is **external and user-scoped**: it stops *any* request that runs as that SAP
user, in any session (HTTP, RFC) — not just the user's, and **not a standalone SAP GUI run**. The
code has to run while the debugger listens: triggered from somewhere else (a UI click, an HTTP call,
a separate RFC call, a test run), or — with mcp-abap-adt — started by the debugger itself (`run`).
The stopped request hangs until you step on or release it.
**One listener per SAP user.** While a debugger listens, the same user's Eclipse/ADT debugging is
suspended ("Breakpoint Activation Suspended") — for everyone using that user. mcp-abap-adt refuses
to start while another debugger listens for the user; **never use `DebugTakeOverListener`** (it
displaces that debugger — possibly a colleague's Eclipse) unless the user says so explicitly. Keep
sessions short and remind the user afterwards to refresh the breakpoint activation in Eclipse.
**Two routes to the system** — the debugger uses SAP's own ADT debugger resources either way, with
nothing installed on the server: HTTPS, or RFC for systems where HTTP ADT is switched off (403) or
that are reachable only through a SAProuter (mcp-abap-adt: `SAP_CONNECTION_TYPE=rfc`,
`SAP_SAPROUTER`; vsp: `saprouter` / route in `rfc_host`, see tools.md).
## 0. Is there a dump already?
If the question is about a runtime error, start post-mortem: the dump tools (`RuntimeListFeeds` /
`RuntimeGetDumpById` in mcp-abap-adt, `ListDumps` / `GetDump` in vsp). Often the termination point
and stack answer it without a live session. Go live only if you need values the dump doesn't show.
## 1. Plan before touching the system
Agree with the user, in one short message:
- **System**: never debug on a production system. If the system role is unclear, ask.
- **Where**: read the live source first (`GetClass`, `GetInclude`, `GetFunctionModule`, …) — the
code may have changed since anyone last looked. Pick the line by its **statement**, counted in the
object's source **as ADT shows it** (for a class: its whole main source, not a method include).
- **Whose requests**: which SAP user will run the code? The breakpoint must be for that user
(mcp-abap-adt: the connected user, or `request_user` — which needs debug authorization for that
user). Ask the user for the name; don't read credential files to find out.
- **Shared user?** If several people/processes run as that user (training, sandbox, integration
users), an unconditioned breakpoint catches **their** requests too. Use a **line breakpoint with a
condition on a value only this test uses** — a made-up material number, search term or test record
— never a value others are likely testing right now. Statement, exception and message breakpoints
catch everyone's requests (mcp-abap-adt offers conditions only on line breakpoints): on a shared
user avoid them, or keep the listen to seconds.
- **Coordination**: if the project has a coordination channel or board for the shared system,
announce the breakpoint there first and check nobody else is testing the same object.
- **Trigger**: who runs the code and how (step 3).
## 2. Start — mcp-abap-adt
`DebugStartListener` with `breakpoints` (at least one):
- line: `{ object_type: CLAS|PROG|INCL|FUNC, object_name, line, condition }` — `include` for a class's
definitions/implementations/macros/testclasses, `parent_name` (the function group) for `FUNC`;
- or `{ exception_class }`, `{ statement }`, `{ message: { id, number, type } }` (all three).
It answers `state_handle` (pass it to every later call), the placed and **refused** breakpoints
(each with SAP's reason — a refused one means nothing will stop there: fix it before triggering),
and `state: listening`. If it is refused because another debugger listens for the user, stop and
tell the user (step "One listener per SAP user").
## 3. Trigger, then wait
- **The debugger starts it** (best for a class with `if_oo_adt_classrun` or a report): pass
`run: { kind: class|program, name }` to `DebugStartListener`. Its output comes back when the session
ends.
- **The user triggers** (a UI action, an HTTP call): say exactly what to run, with the unique
condition value, right after the start.
- **You trigger** (an HTTP or RFC call the user approved): start it in the background after the
listener runs. Never through the same MCP server's own calls.
- Then `DebugWait` (`hold_seconds` ≤ 30) in a loop until `state` is `stopped` — or `ended` (the run
finished without stopping: the breakpoint or its condition was not reached). Give up after a
sensible budget (a few minutes), report, and `DebugStop`.
## 4. When it stops — confirm it's yours
Read the `at` position and the input variables (`DebugGetVariables` with `names`). **Check the
values match your trigger** before treating anything as the test result. If they don't (someone
else's request), say so, `DebugStep action=continue` at once, and rethink the condition.
## 5. Inspect and step
- Variables: `DebugGetVariables` — `names` take ABAP paths (`LV_X`, `LS_S-COMP`, `LO_REF->ATTR`,
`LR_DATA->*`, `CLASS=>STATIC`, `LT_TAB[3]-COMP`); `parents` lists members (`ME`, an object id, a
structure, a table). `detail: full` adds visibility, static/instance and the inheriting class.
Stack: `DebugGetStack`; read in another frame: `DebugSetStackPosition`.
- Steps: `DebugStep action=into|over|return|continue`; run to a line: `DebugStepToLine mode=run`
with the line's object address.
- **Never** `DebugStepToLine mode=jump`, `DebugSetVariable` or `DebugTerminate` (they change what the
program does, or kill it) unless the user asks for it explicitly and understands that.
- Keep the stop short — the triggering request (and its user) is waiting and may time out.
- A breakpoint added while already stopped may not stop the current run: set breakpoints before the
code reaches them.
## 6. Release and clean up — always
`DebugStop` — it releases a stopped debuggee, removes the session's breakpoints, stops listening and
closes its connections; anything it could not undo it reports (retry `DebugStop` then). Do this even
if something went wrong earlier. Where an SQL tool is available, confirm on the system that none of
the user's external breakpoints remain: `SELECT username, bp_index FROM abdbg_extdbps WHERE username
= '<USER>'` → 0 rows. Remove the coordination note if you posted one.
## 7. Report
What stopped where (statement + stack summary), the variable values that answer the question
(as a short list `name = value — note`, not a table: values are often too long for a cell), what
the step(s) showed, whether the stop was confirmed as your trigger, and that the breakpoint is gone.
Mark anything you inferred rather than saw in the debugger as your assessment.
## With vibing-steampunk instead
Same plan, same rules; the tools differ:
- `SetBreakpoint(program, line, condition?)` — the line in the source as vsp reads it; for a function
module the line counts in its **include** (`L<group>U<nn>`) — read that include first. Check with
`GetBreakpoints`. The first call takes ~20–25 s.
- `DebuggerListen(timeout=120..240)` blocks until a stop; start a background trigger *before* it, or
ask the user to trigger *now*. vsp's own calls never stop at its own breakpoints. On RFC-only
systems a separate `vsp rfc call <FM> '<json>'` process is a good trigger (in Git Bash prefix
`MSYS_NO_PATHCONV=1`, or `/H/…` routes get mangled into `H:/…`).
- Inspect: `DebuggerGetStack`, `DebuggerGetVariables(variable_ids?)`; step: `DebuggerStep` —
`stepRunToLine` needs a vsp with oisee/vibing-steampunk#367 (older: use repeated `stepOver`;
never send it without the target — SAP releases the program).
- Release: `stepContinue` (an `AdiFailed` / `debuggeeEnded` answer is the continue having worked),
then `DeleteBreakpoint('all')`, `GetBreakpoints`, `DebuggerDetach`, and the `abdbg_extdbps` check.