Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Debuginng

Former Member
0 Kudos

What is Watch point, In Debugging Mode What is the use of Append and insert Tab

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

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.
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

<<br /> 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

There are also different display modes that provide various information and display the contents of individual fields, tables, and so on:

Reward if usefull

5 REPLIES 5

Former Member
0 Kudos

Hi,

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.

debugger contains the watchpoint option in it..

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

> greater than

similarly <= , = , <> ,>=.

6. 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.

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.

Go through these threads for more information on debugging,

1)

2)

3)

4)

some more links .....

Introduction: http://www.saplinks.net/index.php?option=com_content&task=view&id=24&Itemid=34

A PDF file to know knowledge about Debugging

Some more links:

http://www.sap-basis-abap.com/sapab002.htm

Debug Background Programs: http://www.sapdevelopment.co.uk/tips/debug/debug_backjob.htm

Debugger: http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm

Regards,

Omkar.

Former Member
0 Kudos

Hi

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.
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

<<br /> 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

There are also different display modes that provide various information and display the contents of individual fields, tables, and so on:

Reward if usefull

mahaboob_pathan
Contributor
0 Kudos

Watch point:

place cursor on where we want to create watch point and press on WATCH POINT.

then main use of this watch point is to see where the process is going on and to see the process of which you want to execute.

we can give ''n' no of watch points in a programs.

In debugging mode

append is used to update the existing record like any modifications.

insert is used to insert any new record to the internal table but it we be inserted at the end of the table contents.

Former Member
0 Kudos

Hi

The Insert and Append functions allow you to add a new line to an internal table. If you choose Append, the new line is added to the end of the table. If you choose Insert, you can add the new line at any position in the table. To insert a new line at the end of the table:

1. Choose Append.

2. Enter a value for the first field of the line.

3. Choose ENTER . The system adds a new line to the end of the table, containing the value that you entered for the first field.

4. Enter values in the remaining fields as described above.

If you want to add a line in the middle of the internal table, place the cursor on the line after which you want to insert it. Choose Insert, then follow the procedure described above from step 2.

<b>Reward if usefull</b>

Former Member
0 Kudos

Suppose you need to de-bug your source code many times and for each time you will repeat the same process so for avoiding that you can set watch-point in de-bug mode for you perticular condition or any perticular source code at which you need to concentrate so that while de-bugging it will directly come to that point or it won't miss that point to come as while by using normal de-bugging there is a chance of missing that point. So its always better to set watch-point while de-bugging.

Also INSERT and APPEND is used in de-bugging mode for following purpose. Suppose you are checking one internal table with some records in de-bug mode and for satisfying some sort of condition you want to add another record into that internal table so this can be done with the mentioned tabs. With INSERT you can insert the recors in between the existing records and with APPEND tab you can add record at the end of the internal table at run time.