Using Watchpoints

Prerequisites

You can use watchpoints for variables only during a running ABAP debug session.

Context

When debugging ABAP code, you can use watchpoints to track the value of individual ABAP variables. The ABAP debugger stops as soon as the value of a watched variable has changed. Furthermore, you can specify conditions for watchpoints. The debugger then additionally checks whether this condition is fulfilled.

Procedure

  1. Setting Watchpoints for Currently Selected Field in the Source Editor
    1. In the ABAP source code editor of the Debug perspective, position the cursor on the field in question.
    2. Open the context menu and select the option Set Watchpoint.
  2. Setting Watchpoints in the Variables View
    1. In the Variables view of the Debug perspective, select the node for the variable in question.
    2. Open the context menu and select the option Set Watchpoint.
      Setting watchpoints in the Variables view of the Debug perspective
      Setting watchpoints in the Variables view of the Debug perspective
  3. Specifying Conditions for Watchpoints
    1. Open the Breakpoints view of the Debug perspective.
    2. Select the node for the watched variable.
    3. Enter a valid condition in the corresponding entry field.

      See also: Conditions for Watchpoints

      Editing a watchpoint condition
      Editing a watchpoint condition

Results

Once the watchpoint has been created for the debug session, the value of the specified variable will be monitored. The ABAP debugger stops as soon as the value of the variable is changed after a debug step or the specified condition for the watchpoint is fulfilled.

Once the watchpoint is reached, the editor range indicator displays a small watchpoint decorator.

Watchpoint decorator in the source editor
Watchpoint decorator in the source editor