on 02-06-2008 4:17 PM
Where we use watch point?
Watchpoints
Like a breakpoint, a watchpoint is an indicator in a program that tells the ABAP runtime processor to interrupt the program at a particular point. Unlike breakpoints, however, watchpoints are not activated until the contents of a specified field change. Watchpoints, like dynamic breakpoints, are user-specific, and so do not affect other users running the same program. You can only define watchpoints in the Debugger.
Use
You set watchpoints in the Debugger to monitor the contents of specific fields. They inform you when the value of a field changes. When the value changes, the Debugger interrupts the program.
Features
You can set up to five watchpoints in a program.
You can also specify the conditions on which a watchpoint is to become active.
You can specify logical conditions between up to five conditional watchpoints.
You can define watchpoints as either local or global. If you define a global watchpoint, it is active in all called programs. Local watchpoints are only active in the specified program.
You can change and delete watchpoints.
Setting Watchpoints
If you want to interrupt a program when the contents of a field or structure change, use a watchpoint. You can set up to five watchpoints, including watchpoints for strings.
A watchpoint can be either local or global. Local watchpoints are only valid in the specified program. Global watchpoints are valid in the specified program, and also in all the other programs it calls.
Procedure
To set a watchpoint, start the Debugger and proceed as follows:
1. Choose Breakpoint  Create watchpoint or the corresponding pushbutton. The Create Watchpoint dialog box appears.
2. Decide whether you want to set a local or global watchpoint.
3. Enter the program and the name of the field for which you want to set the watchpoint. In the Program field, the name of the program currently running is always defaulted.
4. If you want your watchpoint to be activated each time the contents of the field change, the definition is now complete, and you can return to the Debugger by pressing ENTER .
5. To create a conditional watchpoint, that is only activated when a particular situation arises, choose one of the following relational operators.
Operator Meaning
< Less than
<= Less than or equal
= Equal
<> Not equal
>= Greater than or equal
> Greater than
6.
7. You can use the Comparison field option to specify whether the comparison is to be carried out with a value that you specify or with the contents of another field. Depending on your choice from step 6, enter a value or a field for the comparison.
Result
The system confirms the watchpoint and adds it to the list in the display. When you finish your debugging session, the watchpoint is automatically deleted unless you have explicitly saved it.
Specifying Logical Links
If you have more than one conditional watchpoint, you can specify a logical link between them:
OR Only one of the specified conditions must be met
AND All of the conditions must be met.
To create a logical link between watchpoints:
1. Choose Goto  Control debugging  Watchpoints or the Watchpoints pushbutton to open the watchpoint display.
2. Set the Logical operator between watchpoints option.
The default value is always OR .
Changing Watchpoints
1. Choose Goto  Control debugging  Watchpoints or the Watchpoints pushbutton to display the watchpoint list.
2. Choose the pencil icon in the line containing the watchpoint you want to change.
3. Change the watchpoint attributes in the Create/Change Watchpoint.
3. Choose ENTER .
Deleting Watchpoints
You cannot delete watchpoints by choosing Breakpoint  Delete or Breakpoint  Deactivate/activate. Instead, proceed as follows:
1. Choose Goto  Control debugging  Watchpoints or the Watchpoints pushbutton to display the watchpoint list.
2. Choose the trashcan icon in the line containing the watchpoint you want to delete.
3.
Memory Monitoring with Watchpoints
You can use watchpoints to display changes to the references of strings, data and object references, and internal tables. By placing an ampersand (&) in front of the object name, you can display the reference in question in hexadecimal format. With internal tables, you can also display the table header by placing an asterisk (*) at the beginning of the name.
&objectname Displays the references of strings, internal tables as well as data and object references
*itab Displays the table header of the internal table itab
Analyzing Source Code
The Debugger contains an extensive range of functions that help you to analyze the source code of a program. You can step through the source code of a program in four different ways.
Displaying the Source Code
All of the display modes in the Debugger have the same structure. The top half of the screen displays an extract from the program source code as it appears in the ABAP Editor.
Features
The Source code of field contains an extract from the program, subroutine, or function module currently being processed. The source code display also contains the following additional functions:
Expand/Reduce Program Segment
Use this button to close the information about the current display mode. The system then displays more of the source code.
Use this button to reopen the information for the current display mode.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
A watchpoint allow you to detect changes to a field.
The debugger interrupts the execution of the program
whenever the contents of the field change.
Like dynamic breakpoints, watchpoints are
user-specific. This means that they do not affect the
execution of the program by other users.
where as
Breakpoint type set for a particular field in the
debugger.
This will affect the ececution of the program by other
users.
Reward point if usefull to u.
Regards
SFT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you want the control to stop when a particular variable attains a particular value, then you use watchpoint.
For example, if you want the debugging control to stop when the variable v_index attains a value 100, the control would stop when the v_index reached value 100.
Code:
v_index = 0.
do 200 times.
v_index = v_index + 1.
enddo.
The debug will not stop till the 100th loop.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.