ABAP Cloud Debugging: Tools & Techniques 2025

Category
Tools
Published
Author
Johannes

Debugging in ABAP Cloud is different from Classic ABAP. This guide shows you the new tools and techniques.

What’s Different in ABAP Cloud?

No Longer Available

  • /h debugger command
  • SAP GUI Debugger (SE38, SE80)
  • BREAK-POINT statement
  • Dynpro debugging
  • Direct DB access in debugger

New Tools

  • ADT Debugger (Eclipse)
  • ABAP Console (cl_demo_output)
  • Feed Reader (Background Jobs)
  • Application Log (BAL)
  • SQL Trace (Performance)

1. ADT Debugger (Main Tool)

Starting the Debugger

Method 1: Set breakpoint

  1. In ADT: Double-click on line number → Breakpoint (blue dot)
  2. Run program (F9 or Preview)
  3. Debugger stops at breakpoint

Method 2: Run As → ABAP Application (Debug)

  1. Right-click on class/program
  2. Debug AsABAP Application

Debugger Layout

┌─────────────────────────────────┐
│ Code (current line marked) │
├─────────────────────────────────┤
│ Variables (variable values) │
├─────────────────────────────────┤
│ Breakpoints (all breakpoints) │
├─────────────────────────────────┤
│ Call Stack (call history) │
└─────────────────────────────────┘

Key Shortcuts

ShortcutAction
F5Step Into (jump into method)
F6Step Over (execute line)
F7Step Return (return from method)
F8Resume (to next breakpoint)
Ctrl+Shift+BToggle Breakpoint
Ctrl+Alt+BShow all breakpoints

Inspecting Variables

METHOD calculate.
DATA(lv_a) = 5.
DATA(lv_b) = 3.
DATA(lv_result) = lv_a + lv_b. " Breakpoint here
" In Variables tab:
" lv_a = 5
" lv_b = 3
" lv_result = 8
ENDMETHOD.

Changing variables:

  1. Right-click on variable → Change Value
  2. Enter new value
  3. Continue debugging with changed value

Watchpoints

Stops when variable changes:

  1. Right-click on variable → Toggle Watchpoint
  2. Debugger stops on every change

Conditional Breakpoints

Only stop when condition is met:

  1. Right-click on breakpoint → Breakpoint Properties
  2. Condition: lv_id = '12345'
  3. Only stops when lv_id has this value

2. ABAP Console (Output During Development)

Instead of WRITE or debug outputs:

METHOD process_data.
" Simple output
cl_demo_output=>display( 'Starting processing' ).
" Output variable
cl_demo_output=>write( |Customer ID: { lv_customer_id }| ).
" Output table
cl_demo_output=>write( lt_customers ).
" Final output
cl_demo_output=>display( ).
ENDMETHOD.

Output:

  • Appears in Console tab in ADT
  • Only use in development!
  • In production: Use Application Log

Advantages:

  • Faster than debugger
  • For complex data structures
  • Stays in log (scrollable)

3. Logging with Application Log

For production code:

METHOD process_order.
TRY.
" Create log
DATA(lo_log) = cl_bali_log=>create_with_header(
header = cl_bali_header_setter=>create(
object = 'ZORDERS'
subobject = 'PROCESS'
external_id = |Order { iv_order_id }|
)
).
" Info message
lo_log->add_item(
item = cl_bali_free_text_setter=>create(
severity = if_bali_constants=>c_severity_information
text = |Processing order { iv_order_id }|
)
).
" Processing...
" Success message
lo_log->add_item(
item = cl_bali_free_text_setter=>create(
severity = if_bali_constants=>c_severity_status
text = 'Order processed successfully'
)
).
" Save log
cl_bali_log_db=>get_instance( )->save_log( log = lo_log ).
CATCH cx_bali_runtime INTO DATA(lx_error).
" Error handling
ENDTRY.
ENDMETHOD.

View log:

  • Transaction SLG1 (Classic)
  • Fiori App: “Application Logs”

Severity levels:

  • c_severity_error - Error (red)
  • c_severity_warning - Warning (yellow)
  • c_severity_information - Info (blue)
  • c_severity_status - Status (green)

4. SQL Trace (Performance Debugging)

Problem: Find slow SELECT statements

Activate SQL Trace

In ADT:

  1. RunRun Configurations
  2. Tab Trace Requests
  3. Enable SQL Trace
  4. Run program

Analyze Trace

SQL Console opens:

SELECT * FROM kna1
Duration: 1.2s ❌ SLOW!
Rows: 1,000,000
SELECT name1 FROM kna1
WHERE kunnr = '12345'
Duration: 0.001s ✅ Fast
Rows: 1

Optimization:

  • ❌ Avoid SELECT *
  • FOR ALL ENTRIES with empty table
  • ✅ Explicit fields
  • ✅ WHERE on indexed fields

5. Feed Reader (Background Jobs)

Problem: Debug background jobs

Setup

  1. Start job (Fiori App / SM37)
  2. In ADT: WindowShow ViewFeed Reader
  3. Enter Feed URL:
    https://<system>/sap/bc/adt/runtime/traces/abaplogs

Output

Feed Reader shows:

  • Console outputs
  • Application Logs
  • Runtime errors

Live updates while job runs!


6. Debugging Strategies Without Debugger

Strategy 1: Unit Tests

Instead of debugging: Write tests

METHOD test_calculate_discount.
" Given
DATA(lv_amount) = 1000.
" When
DATA(lv_discount) = zcl_pricing=>calculate_discount( lv_amount ).
" Then
cl_abap_unit_assert=>assert_equals(
act = lv_discount
exp = 100
msg = |Expected 100, got { lv_discount }| " Debug info!
).
ENDMETHOD.

Advantage: Reproducible, automated

Strategy 2: Defensive Assertions

METHOD process_order.
" Check precondition
ASSERT iv_order_id IS NOT INITIAL.
" Business logic
DATA(lv_customer) = get_customer( iv_order_id ).
" Check postcondition
ASSERT lv_customer IS BOUND.
ENDMETHOD.

In production: ASSERT is ignored (only active in debug mode)

Better for production: Exceptions

IF lv_customer IS NOT BOUND.
RAISE EXCEPTION TYPE zcx_customer_not_found.
ENDIF.

Strategy 3: Logging Framework

Custom logging wrapper:

CLASS zcl_logger DEFINITION.
PUBLIC SECTION.
CLASS-METHODS log
IMPORTING iv_level TYPE string DEFAULT 'INFO'
iv_text TYPE string.
ENDCLASS.
CLASS zcl_logger IMPLEMENTATION.
METHOD log.
" In Dev: Console
IF sy-sysid = 'DEV'.
cl_demo_output=>write( |[{ iv_level }] { iv_text }| ).
ELSE.
" In Prod: Application Log
" ... BAL code ...
ENDIF.
ENDMETHOD.
ENDCLASS.
" Usage
zcl_logger=>log( iv_level = 'DEBUG'
iv_text = |Processing customer { lv_id }| ).

7. Common Debug Scenarios

Scenario 1: Exception in RAP

Problem: Validation fails, but why?

METHOD validateIsbn.
READ ENTITIES OF zi_book IN LOCAL MODE
ENTITY Book
FIELDS ( Isbn )
WITH CORRESPONDING #( keys )
RESULT DATA(lt_books).
LOOP AT lt_books INTO DATA(ls_book).
" Debug output
cl_demo_output=>write( |Checking ISBN: { ls_book-Isbn }| ).
IF strlen( ls_book-Isbn ) <> 13.
cl_demo_output=>write( 'ISBN invalid - length mismatch' ).
APPEND VALUE #( ... ) TO reported-book.
ENDIF.
ENDLOOP.
cl_demo_output=>display( ).
ENDMETHOD.

Scenario 2: CDS View Returns Wrong Data

Strategy:

  1. SQL Console: Query CDS View directly
  2. Data Preview: In ADT right-click on view → Open WithData Preview
  3. Check source tables: Is raw data correct?

Scenario 3: Performance Problem

Approach:

  1. Activate SQL Trace
  2. Identify slow SELECTs
  3. ABAP Console: Log timestamps
DATA(lv_start) = cl_abap_context_info=>get_system_time( ).
" Slow operation
SELECT ... INTO TABLE lt_data.
DATA(lv_end) = cl_abap_context_info=>get_system_time( ).
cl_demo_output=>write( |Duration: { lv_end - lv_start } µs| ).

8. Debugging Best Practices

DO

  1. Set breakpoints sparingly (not 50 of them!)
  2. Conditional breakpoints for large datasets
  3. Unit tests instead of live debugging
  4. Logging in production code
  5. SQL Trace for performance

DON’T

  1. Debug production (only as last resort!)
  2. Leave BREAK-POINT in code
  3. Console output in production
  4. Use debugger as only tool

9. Tools Overview

ToolUse CaseWhere available?
ADT DebuggerInteractive debuggingADT/Eclipse
ABAP ConsoleQuick outputsADT (Dev only)
Application LogProduction loggingAll systems
SQL TracePerformance analysisADT
Feed ReaderBackground job logsADT
Data PreviewCheck CDS View dataADT

Summary

ABAP Cloud Debugging Workflow:

1. Write unit tests
↓ (if test fails)
2. Use ADT Debugger
↓ (performance problem?)
3. Activate SQL Trace
↓ (production?)
4. Analyze Application Log

Mindset shift:

  • Classic ABAP: Debugger-First
  • ABAP Cloud: Test-First, Logging, then Debugger

See also:

Happy Debugging!