SAP Debug ABAP
Debugging lets you step through ABAP and inspect data at runtime. This guide shows how to start and use the debugger effectively.
To debug ABAP, set a breakpoint in the editor or type /h in the command field before running the transaction, then step with F5 into, F6 over and F7 return while inspecting variables and internal tables. The skill is breaking in the right place: a breakpoint on the error message or exception beats stepping through thousands of lines.
- Watch out: a session breakpoint never fires for an OData or RFC call; those need an external breakpoint.
Step by step
- Set a breakpoint: in the editor (ADT/SE80), or type
/hin the command field before running a transaction. - Run the program/transaction; execution stops at the breakpoint.
- Step through with F5 (into), F6 (over), F7 (return); inspect variables and internal tables.
- Use conditional/statement/exception breakpoints to break at the right place (e.g. on a message or exception).
- Fix the issue in code (in DEV), then re-test.
Notes and tips
The skill is breaking in the right place, use a breakpoint on the error message or exception rather than stepping through thousands of lines. Watchpoints break when a variable changes. Be careful changing values, especially in production (tightly controlled). Reading ST22 dumps complements debugging.
Common pitfalls
- Following steps without understanding the concept.
- Skipping testing in a non-production system.
- Applying blindly to a different scenario.