Skip to main content

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
Modern Standard

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 /h command 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.

Use Carefully

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

Best Practice

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

Interview Tip

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

Powerful Tool

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

Do Not Ignore Dumps

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

Modern Debugging Flow

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

Use with Care

SQL Trace is system-intensive. Use it only for short durations and specific users.

6. Debugging Performance Issues (7.5+ Mindset)​

Modern Approach
  • First analyze with ST05

  • Check Open SQL usage

  • Look for SELECTs inside loops

  • Optimize using JOINs or CDS

7. Common Debugging Mistakes​

Avoid These
  • 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​

  1. Debug a report using dynamic breakpoints.

  2. Set a watchpoint on a changing variable.

  3. Analyze a dump in ST22.

  4. Trace SQL execution using ST05.

  5. Identify performance bottlenecks.

10. What’s Next?​

➡️ Module 10: Messages & Exception Handling

Learning Tip

A developer who can debug confidently is always valued higher than one who only writes code.