Show TOC

Using WatchpointsLocate this document in the navigation structure

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. More on this: Watchpoints

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
      Figure 1: 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 watchpoint.
    3. Enter a valid condition in the corresponding entry field.

      See also: Conditions for Watchpoints

      Editing a watchpoint condition
      Figure 2: 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 and 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
Figure 3: Watchpoint decorator in the source editor
Tip

You can use the context menu of the watchpoint to access the watchpoint-related actions.

Watchpoint-related actions
Figure 4: Watchpoint-related actions
Note ABAP watchpoints are always short-living, both in the GUI Debugger as well as in the Debug perspective of ABAP Development Tools. They can only be active within a suspended debug session and are removed automatically when that debug session is terminated.