When You have to find the value of changing variable during RunTime, you can apply a watch to that variable while debugging.
It is much Helpful.
2006-10-01 21:44:10
·
answer #1
·
answered by Rohit A 2
·
0⤊
0⤋
http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/792442db42e22ce10000000a1550b0/frameset.htm
Summary
Watchpoints allow you the option of monitoring the content of individual variables.
The Debugger stops as soon as the value of the monitored variable changes.
In addition, conditions can be specified. The Debugger also checks whether such a condition is fulfilled.
Detailed Description
Creating a Watchpoint
In the toolbar of the New Debugger, you will find the pushbutton Create Watchpoint This graphic is explained in the accompanying text. It brings you to the dialog box Create Watchpoint.
Using this function, you can enter the variable to be monitored.
All possible ABAP data structures are allowed here.
---------------------------------------------------------------------------------------------------------------------------------
Special Case: Watchpoint for Internal Table
Setting a watchpoint for an internal table may have a negative effect on performance during program runtime and also cause an increase in memory consumption.
The reason for this is that a “clone” of the original data object is created for the watchpoint on a table (as for every other watch point as well).
If the table for which the watchpoint was set has become too large, you must take into consideration that the "clone" will have the same size. With very large internal tables, this can lead to memory bottlenecks.
In some cases, therefore, it can be a good idea to have watchpoints for internal tables active only for short program durations.
Note
In those cases where you are interested solely in changes to the number of lines in the internal table, you can proceed as follows:
Set a watchpoint for a header in the internal table – for example, ."*ITAB[]", possibly with the condition
Not equal to current number: "LINES( ITAB ) <> 1000"
---------------------------------------------------------------------------------------------------------------------------------
When you create a watchpoint, the variable taken as the default value for the watchpoint is the variable on which the cursor is currently positioned (in the editor or another tool).
You can only set watchpoints for variables of the current context (program).
For local variables, you can specify whether the watchpoint is to apply to the current procedure instance or to all instances that were ever called for this procedure. Particularly for recursive calls of the procedure, this difference can be of importance.
In addition, you can enter any arbitrary condition in the following box “Condition”. Only if the watchpoint variable changes AND the condition is fulfilled will the Debugger stop.
The condition must match the following syntax:
Operator
The following functions are available here. (The syntax is identical to ABAP syntax.)
For internal tables (for example, internal table ITAB):
o LINES( ITAB ) – Number of table rows
For strings(for example, string S):
o STRLEN( S ) - Current length of the string
Examples of allowed conditions
· sy-index > 5
· sy-index = sy-tabix
· lines( itab ) > 0
· lines( itab ) <> sy-tabix
· lines( itab ) < lines( itab )
· strlen( s ) >= sy-index
·
·
Watchpoint is reached
After you have created the watchpoint, the value of the variable will be monitored.
As soon as a change is found in the content of the variable after a Debug step and any conditions set have been met, the Debugger will stop and you see the message "Watchpoint is reached ()“.
In the Breakpoints tool (desktop Breakpoints/Watchpoints / Tab Watchpoints), you can view this reached watchpoint in detail.
The reached watchpoint is marked with a yellow arrow. The old and the new values of the watchpoint variable are at your disposal.
In addition, you can use the pushbutton Compare Variables (This graphic is explained in the accompanying text) to determine the differences between the old and the new variable.
In addition, you can maintain the watchpoint in this view – that is change, activate, deactivate, or delete it.
·
Validity Area for Watchpoints
· In contrast to breakpoints, watchpoints are only valid locally in the roll area. If a roll area changes, none of the watchpoints defined in the underlying roll area are visible. Also, watchpoints that were created in the New ABAP Debugger cannot be used further in the Classic Debugger (for example, after changing the Debugger) and vice versa.
2006-10-02 03:56:04
·
answer #2
·
answered by roy_s_jones 6
·
0⤊
0⤋