Debugging

A watchpoint stops execution when a variable changes (optionally when a condition becomes true, e.g.

38.1 Starting the debugger

Type in the command field, then execute — debugger starts at the next step

Set in editor (SE38 / ADT double-click on the ruler); valid for your session External (user) breakpoint

For HTTP/RFC calls (Fiori, OData) — set in ADT or "external breakpoint" in SAP GUI; valid for your user, survives sessions (2 h by default) BREAK-POINT. / BREAK sy-uname.

Hard-coded statements (never transport them; ATC flags them)

SM37 → select job → JDBG in the command field; or SM50 → *Debug* for a running process

Drag a text file containing [FUNCTION] Command=/H Title=Debugger Type=SystemCommand onto the popup Update/system debugging

Debugger settings: *Update debugging*, *System debugging*

38.2 The new ABAP debugger (SAP GUI) and ADT debugger

Controls: F5 single step (into), F6 execute (over), F7 return (out), F8 continue; *Go to statement* (Shift+F12 in GUI) to jump.

Desktops/tabs: variables, structures, internal tables (edit, sort, filter, add rows), objects, call stack, breakpoints, watchpoints, memory analysis, Diff tool (compare tables/objects).

Change variable values at runtime (requires debug-change authorization; logged).

ADT debugger: Variables view, Breakpoints view, Expressions, conditional breakpoints, *Debug As → ABAP Application*, debugging of RAP handlers and AMDP (SQLScript) procedures.

38.3 Breakpoint types

Every CALL FUNCTION, SELECT, MESSAGE, RAISE, COMMIT WORK, AUTHORITY-CHECK … Method/function breakpoint Entry of a specific method or FM

When a given exception class is raised (even if caught) When a specific message ID/number is issued

Line + condition (e.g. ls_order-order_id = '42')

38.4 Watchpoints

A watchpoint stops execution when a variable changes (optionally when a condition becomes true, e.g. lv_total > 1000). Ideal for "who changed this field?" questions. Set via *Watchpoint* button, specifying the variable (local, global, or (PROGRAM)VARIABLE).

38.5 Checkpoints and logpoints

Checkpoint groups (SAAB) activate BREAK-POINT ID zgroup, ASSERT ID zgroup CONDITION …, and LOG-POINT ID zgroup … statements without transports.

Dynamic logpoints (ADT, 7.53+/SAP_BASIS 7.54) write log entries at runtime without code changes — useful in production.

38.6 Analyzing dumps and other tools

ST22: short dumps with "What happened?", "Error analysis", source extract, call stack, and a link to the debugger (if still possible) — ADT has a *Feed Reader* / *ABAP Runtime Errors* view.

SM21 system log, SLG1 application log, SM13 update errors, ST05/SAT traces, SRT_UTIL web service traces, /IWFND/ERROR_LOG and /IWBEP/ERROR_LOG for OData.

Layer-aware debugging and *Debugger scripting* (SAS) for automating complex analysis.