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
- Setting Watchpoints for Currently Selected Field in the Source Editor
- In the ABAP source code editor of the Debug perspective, position the cursor on the field in question.
- Open the context menu and select the option Set Watchpoint.
- Setting Watchpoints in the Variables view
- In the Variables view of the Debug perspective, select the node for the variable in question.
- Open the context menu and select the option Set Watchpoint.
Figure 1:
Setting watchpoints in the Variables view of the Debug perspective
- Specifying Conditions for Watchpoints
- Open the Breakpoints view of the Debug perspective.
- Select the watchpoint.
- Enter a valid condition in the corresponding entry field.
See also: Conditions for Watchpoints
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.
Figure 3:
Watchpoint decorator in the source editor
Tip
You can use the context menu of the watchpoint to access the
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.