Start ABAP Debug Listener
sap_debug_attachPrepare an ABAP debugging session by validating the user scope and creating a session handle, so you can later trap the user's execution under breakpoints.
Instructions
Open a debug session handle and confirm this server may listen for a user's execution.
BEHAVIOUR CHANGED (the old 'attach to a terminal/session id' had no counterpart in the ADT protocol — there is no debug-session resource). ADT debugging is listener-based: you arm a listener for a USER, and the first line that user executes under a breakpoint traps and freezes their work process. This call validates the scope and creates the handle; sap_debug_wait is what actually registers the listener and blocks.
Workflow:
sap_debug_attach (this call — validates, returns session_id)
sap_set_breakpoint (one or more)
run the ABAP code AS THAT USER (SAP GUI, a transaction, an RFC…)
sap_debug_wait (registers the listener, blocks until the code traps)
sap_debug_variables / sap_debug_eval / sap_debug_step
sap_debug_detach (ALWAYS — clears breakpoints, releases the debuggee, deletes the listener)
Args:
user (string): user to trap. Default SAP_USER. The old 'terminal_id' argument is gone; it named a target the protocol does not have.
mode ('user' | 'terminal'): debugging scope (default 'user').
take_over (boolean): take the scope over from another IDE (default false).
response_format.
Returns (json): { sessionId, state: 'LISTENING', user, mode, message }. sessionId (e.g. 'dbg-1') is a handle in THIS server, not a SAP object. It does not survive a server restart.
Error Handling:
Conflict (HTTP 409): another session holds the debugging scope — the message carries SAP's conflictText and the holding user. Re-run with take_over=true to seize it. A listener this server itself left behind (crashed run) is detected and cleared automatically.
One debug session at a time: detach the current one first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'user' (default): trap any execution by that user. 'terminal': trap only this terminal id — reference-only, not verified on this system. | user |
| user | No | ABAP user whose execution should be trapped. Default: SAP_USER. Debugging another user freezes THEIR session — only do it with their knowledge. | |
| take_over | No | If another IDE (e.g. Eclipse) holds the debugging scope, delete its listener and take over. Default false: report the conflict instead. | |
| response_format | No | Output format: 'markdown' (human-readable, default) or 'json' (structured). | markdown |