Module 9: ABAP Debugging & Runtime Analysis
Debugging and runtime analysis are core skills for every ABAP developer.
A good developer spends more time analyzing runtime behavior than writing new code.
1. ABAP Debugger (New Debugger)
SAP provides the New ABAP Debugger, which is the standard debugger in modern systems.
Key Features
- Multiple tool views
- Object-oriented support
- Memory inspection
- Fast navigation
- User-friendly UI
The New Debugger is the default and recommended debugger for ABAP 7.5+ systems.
Starting the Debugger
Common ways to start debugging:
- Set a breakpoint
- Use
/hcommand before execution - Debug from ST22 or ST05
2. Breakpoints
Breakpoints stop program execution at a specific line.
2.1 Static Breakpoints
Defined directly in the code.
BREAK-POINT.
Or by clicking in the editor margin.
Do not transport code with hard-coded BREAK-POINT.
2.2 Dynamic Breakpoints
Created at runtime via the debugger UI.
-
Valid only for current session
-
Do not modify source code
Prefer dynamic breakpoints during development and testing.
2.3 External Breakpoints
Used for:
-
Background jobs
-
RFC calls
-
xOData / UI5 triggers
Created via:
-
Breakpoint settings in debugger
-
Transaction SE24 / SE80
External breakpoints are essential when debugging non-dialog processes.
3. Watchpoints
Watchpoints stop execution when a variable’s value changes or meets a condition.
Example Use Cases
-
Variable becomes initial
-
Value exceeds threshold
-
Unexpected value assignment
Watchpoints help identify where data gets corrupted, not just where code stops.
4. Runtime Errors (ST22)
What is ST22?
ST22 displays ABAP short dumps, which occur when runtime errors happen.
Common Runtime Errors
-
CX_SY_ITAB_LINE_NOT_FOUND
-
MOVE_CAST_ERROR
-
NULL_OBJECT_REFERENCE
-
DBSQL_SQL_ERROR
Every dump represents a serious runtime failure and must be analyzed.
How to Analyze a Dump
-
Identify error type
-
Check dump location
-
Review variable values
-
Analyze call stack
-
Fix root cause
Many dumps can be debugged directly by navigating from ST22 to source code.
5. SQL Trace (ST05)
What is ST05?
ST05 traces database access performed by ABAP programs.
What You Can Trace
-
Open SQL statements
-
Native SQL
-
RFC calls
-
Buffer usage
Typical Use Case
-
Performance issues
-
Slow reports
-
Unexpected database load
How to Use ST05 (High Level)
-
Activate SQL Trace
-
Execute program
-
Deactivate trace
-
Analyze results
SQL Trace is system-intensive. Use it only for short durations and specific users.
6. Debugging Performance Issues (7.5+ Mindset)
-
First analyze with ST05
-
Check Open SQL usage
-
Look for SELECTs inside loops
-
Optimize using JOINs or CDS
7. Common Debugging Mistakes
-
Debugging without understanding program flow
-
Ignoring dumps
-
Using BREAK-POINT in productive code
-
Tracing entire system instead of specific user
-
Guessing instead of verifying with debugger
8. Summary
-
New Debugger is the standard
-
Use correct breakpoint types
-
Watchpoints are powerful for data issues
-
ST22 is essential for runtime errors
-
ST05 is key for SQL performance analysis
9. Practice Exercises
-
Debug a report using dynamic breakpoints.
-
Set a watchpoint on a changing variable.
-
Analyze a dump in ST22.
-
Trace SQL execution using ST05.
-
Identify performance bottlenecks.
10. What’s Next?
➡️ Module 10: Messages & Exception Handling
A developer who can debug confidently is always valued higher than one who only writes code.