‎2008 Mar 07 6:02 AM
‎2008 Mar 07 6:05 AM
hi!
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.
See also Setting Watchpoints.
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.
See Specifying a Logical Expression.
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.
See Changing Watchpoints.
You can use watchpoints to display changes to the references of strings, data and object references, and internal tables.
See Memory Monitoring with 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:
Choose Breakpoint ® Create watchpoint or the corresponding pushbutton. The Create Watchpoint dialog box appears:
Decide whether you want to set a local or global watchpoint.
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.
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 .
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
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.
Changing Watchpoints
Choose Goto ® Control debugging ® Watchpoints or the Watchpoints pushbutton to display the watchpoint list. The following dialog box appears:
Choose the pencil icon in the line containing the watchpoint you want to change.
Change the watchpoint attributes in the Create/Change Watchpoint.
Choose ENTER .
Deleting Watchpoints
You cannot delete watchpoints by choosing Breakpoint ® Delete or Breakpoint ® Deactivate/activate. Instead, proceed as follows:
Choose Goto ® Control debugging ® Watchpoints or the Watchpoints pushbutton to display the watchpoint list.
Choose the trashcan icon in the line containing the watchpoint you want to delete.
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
Example
If a watchpoint is set for the object in question at runtime, the program is stopped as soon as the reference is changed. A short dump can be intercepted in this way to stop the program being terminated when the memory is overwritten.
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. For further information, refer to Stepping Through the Source Code
For information about functions within the source code display, see Displaying the Source Code
‎2008 Mar 07 6:04 AM
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.
‎2008 Mar 07 6:05 AM
hi!
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.
See also Setting Watchpoints.
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.
See Specifying a Logical Expression.
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.
See Changing Watchpoints.
You can use watchpoints to display changes to the references of strings, data and object references, and internal tables.
See Memory Monitoring with 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:
Choose Breakpoint ® Create watchpoint or the corresponding pushbutton. The Create Watchpoint dialog box appears:
Decide whether you want to set a local or global watchpoint.
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.
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 .
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
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.
Changing Watchpoints
Choose Goto ® Control debugging ® Watchpoints or the Watchpoints pushbutton to display the watchpoint list. The following dialog box appears:
Choose the pencil icon in the line containing the watchpoint you want to change.
Change the watchpoint attributes in the Create/Change Watchpoint.
Choose ENTER .
Deleting Watchpoints
You cannot delete watchpoints by choosing Breakpoint ® Delete or Breakpoint ® Deactivate/activate. Instead, proceed as follows:
Choose Goto ® Control debugging ® Watchpoints or the Watchpoints pushbutton to display the watchpoint list.
Choose the trashcan icon in the line containing the watchpoint you want to delete.
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
Example
If a watchpoint is set for the object in question at runtime, the program is stopped as soon as the reference is changed. A short dump can be intercepted in this way to stop the program being terminated when the memory is overwritten.
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. For further information, refer to Stepping Through the Source Code
For information about functions within the source code display, see Displaying the Source Code
‎2008 Mar 07 6:06 AM
Hi
If suppoe\se in ur internal table , thereare more than 1000000 records . u want to see a particular record which is in 50001, means
u can set awatchpoint for that record. If u press F5 for each record , it ll take time.
So for that it is used.
regards
Karthik
‎2008 Mar 07 6:07 AM
Saran,
Hope the below notes will be of some help.
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.
See also Setting Watchpoints.
· You can also specify the conditions under which a watchpoint is to become active.
· You can specify a logical link for up to five (conditional) watchpoints.
See also Specifying Logical Links.
· 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.
See Changing Watchpoints
· You can use watchpoints to display changes to the references of strings, data and object references, and internal tables.
See Memory Monitoring with Watchpoints
Breakpoints
Apart from being able to execute an ABAP program in the Debugger, you can also start the Debugger call by the choosing a breakpoint. This is achieved by setting one or more of these breakpoints in the program. A breakpoint is a signal at a particular point in the program that tells the ABAP runtime processor to interrupt processing and start the Debugger. The Debugger is activated when the program reaches this point.
There is also a special kind of breakpoint called a watchpoint. When you use watchpoints, the Debugger is not activated until the contents of a particular field change. For more information, refer to the chapter Watchpoints.
Breakpoint Variants
The Debugger contains different breakpoint variants:
Static
A user-specific breakpoint is inserted in the source code as an ABAP statement using the keyword BREAK-POINT. A non user-specific breakpoint is set in the ABAP Editor using the BREAK user name statement.
Directly set
dynamic breakpoints
Can be set in the ABAP Editor or the Debugger by double-clicking a line, for example. Dynamic breakpoints are always user-specific, and are deleted when you log off from the R/3 System.
Breakpoints
at statements
The Debugger stops the program immediately before the specified statement is executed.
Breakpoints
at subroutines
The Debugger stops the program immediately before the specified subroutine is called.
Breakpoints at function modules
The Debugger stops the program immediately before the specified function module is called.
Breakpoints at methods
The Debugger stops the program immediately before the specified method is called.
Breakpoints at exceptions and system exceptions
The Debugger stops the program immediately after a system exception, that is, after a runtime error has been intercepted.
Static Breakpoints
Static breakpoints are always user-independent if there is no specification of a user name. Once a user has inserted the statement BREAK-POINT or BREAK name in an ABAP program, the system always interrupts the program at that point for that user or only for the user name. This procedure is only useful in the development phase of an application when program execution is always to be interrupted at the same place. For more information, refer to the chapter Static Breakpoints.
In HTTP sessions, a static breakpoint is skipped if you did not set additional dynamic HTTP breakpoints in the editor of a BSP page. Instead, a corresponding system log entry is written, which can be checked using transaction SM21.
Dynamic Breakpoints
Dynamic breakpoints are user-specific. Therefore, you should use them if you only want the program to be interrupted when you run it yourself, not when it is being executed by other users. All dynamic breakpoints are deleted when you log off from the R/3 System.
Dynamic breakpoints are more flexible than static breakpoints because you can deactivate or delete them at runtime. They have the following advantages:
· You do not have to change the program code.
· You can set them even when the program is locked by another programmer.
· You can define a counter that only activates the breakpoint after it has been reached.
Special dynamic breakpoints are useful when you want to interrupt a program directly before a particular ABAP statement, a subroutine, or an event, but do not know exactly where to find it in the source code. Event here is used to refer to the occurrence of a particular statement, for example, or calling up a method. Special dynamic breakpoints are user-specific. You can only set them in the Debugger. For more information, refer to the chapter Dynamic Breakpoints.
In HTTP sessions, the system stops both at static and dynamic breakpoints if a dynamic breakpoint was set in the editor of a BSP page before program execution.
Lifetime and Transfer of Breakpoints
A static breakpoint remains intact as long as the BREAK-POINT or BREAK-POINT name statement is not removed from the source code. Without saving, dynamic breakpoints only remain intact in the relevant internal session. However, they remain in effect during the entire user session if they are saved by choosing the menu path Breakpoints ® Save in the ABAP Debugger. For more details on the subject of user sessions and modes, refer to Modularization Techniques in the ABAP keyword documentation.
If you call an HTTP session during a user session, only the HTTP breakpoints are loaded when the HTTP session is started. You activate HTTP debugging in the ABAP Editor by choosing Utilities ® Settings ® HTTP Debugging. Depending on the setting, the system then displays either the HTTP or standard breakpoints in the Editor.
If you call an update session during a user session, breakpoints that were defined beforehand in the calling processing unit are copied to the new update session, where they can be displayed under Breakpoints. If, in the ABAP Debugger, you check Update Debugging under Settings and then, for example, call the update module func using CALL FUNCTION func IN UPDATE TASK, a new window is opened in which you can debug this function module in the update session. All the breakpoints that were set in the calling processing unit can also be processed here.
we can keep them at :
Statements
Subroutines
Function Module Calls
at Methods
System Exceptions
break point :
we can start debugging from that point or if we keep break point at some place we can directly got ot htat point using f6.
watch point: for example if we have to check the output for 4000 records based on a field value i.e.for vendor number 'in'we have to check then we will create watchpoint on field LIFNR value '2000'. then we can directly go to vendor whose numbe ris 2000
K.Kiran.
‎2008 Mar 07 6:07 AM
Hi,
Watchpoints
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 . 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:
).
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 () 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.
Hope this will help.
Regards
Shibin
‎2008 Mar 07 6:08 AM
Chk this Link.
http://help.sap.com/saphelp_nw70/helpdata/en/f1/792442db42e22ce10000000a1550b0/content.htm
Regards
Vinayak
‎2008 Mar 07 6:09 AM
Hi,
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 may 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 other programs that it calls.
Procedure
To set a watchpoint, start the Debugger and proceed as follows:
Choose Breakpoint ® Create watchpoint or the corresponding pushbutton.
The Create Watchpoint dialog box appears:
Decide whether you want to set a local or global watchpoint.
Enter the name of the field for which you want to set the watchpoint.
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 . The watchpoint appears in the watchpoint display.
If you want to specify conditions on which the watchpoint should be activated, continue with step 6.
To create a conditional watchpoint, choose a relational operator. Valid operators:
Operator Meaning
= or EQ Equal
<> or NE Not equal
< or LT Less than
<= or LE Less than or equal
>= or GE Greater than or equal
or GT Greater than
You can use the Comparison field option to specify whether the comparison should be 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.
Choose ENTER to create the conditional watchpoint.
you can set upto 10 watch points.
regards,
vineela
‎2008 Mar 07 6:11 AM
Hi, buddy,
Wtch point is pretty simple.
Unlike break points, in watch point, the code stops when it reaches a particular valuse.
Imagine you have 10 values in your internal table.Tou canoot stop at the 9th value through break pont.You need to use watch point by specifying the value.
Also go through the thread