The ABAP Debugger
Debugging is arguably the most critical skill for an ABAP developer. SAP provides both a classic and new debugger. The new debugger (available since NetWeaver 7.0) offers a modern UI with multiple views and scripting capabilities.
Setting Breakpoints
Static Breakpoints
BREAK-POINT. " Hard breakpoint (stops for all users)
BREAK username. " Stops only for specific user
Dynamic Breakpoints
Set via the debugger UI without modifying code. They persist only for your session.
External Breakpoints
Essential for debugging HTTP calls, RFC, and background jobs. Set in SE80  Utilities  Settings  External Debugging.
Watchpoints
Stop execution when a variable reaches a specific value:
- Set a watchpoint on variable
lv_status - Condition:
lv_status = 'ERROR' - The debugger stops exactly when the condition is met
New Debugger Features
- Desktop 1/2/3 ÔÇö Configure multiple debugging layouts
- Diff Tool ÔÇö Compare internal table contents between steps
- Object Views ÔÇö Inspect class instances and their attributes
- Scripting ÔÇö Automate repetitive debugging tasks with ABAP scripts
Debugging Tips
- Use
/hin any SAP transaction to activate debugging mode - In SM50, select a running process and choose Program  Debugging to attach
- Use ST22 to analyze runtime errors (short dumps)
- Use ST05 SQL Trace alongside debugging to monitor DB calls