Application Development and Automation 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: 
Read only

Watch Point

Former Member
0 Likes
8,788

Hi Experts,

Can any one explain me about Watch Points ?

What are the differences between debugger and watch points ?

Can any one explain me how to use watch points with any sample program, if provided with screen shots.

Thanks in Advance

Regards and Thanks

Vijaya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,298

hi laxmi ,

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.

<b>debugger contains the watchpoint option in it.</b>.

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.

<b>result</b>

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.

<b></b>

8 REPLIES 8
Read only

Former Member
0 Likes
6,298

hi Vijaya Laxmi,

If you put break point it will stop there at the particular point of the source code.

It will not stop in the break point until another break point or the same break point.

Watch point is non to physically putting break point..Instead you can watch

a variable when and where it is getting changed..by creating a watch point on

the variable in the program..

Example for watch point

Go to the debug mode..

Press the create watch point button (shift + f8)..

It will give a popup to enter the program name and field name you have to watch.

Press enter..

It will stop when the field name is getting changed..

Also,

Break points are static, meaning we define break points at certain statements.

Where as Watch points are set dynamic break points, or break points created on the fly.

for example, we can set a watch point, itab-matnr = 'MAT0001'.

When the itab is looped, and the matnr =

'MAT001', the debugger stops (meaning a break point is triggered).

Hope this helps,

Sajan Joseph.

Read only

learnsap
Active Participant
0 Likes
6,298

Hi Viajaya,

Watch points are used while debugging an ABAP program. We can create watch points in the debugging screen of the abap program.

Watch point is created for the variable with the relational operator for the value. The execution will be stopped when the watchpoint get satisfied.

for further information go through the followin links....

Try this link...

http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/792442db42e22ce10000000a1550b0/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/e2/5f5a42ed221253e10000000a155106/content.htm

Regards,

Ramesh Babu S

Read only

Former Member
0 Likes
6,298

Hi vijaya,

check the below links for watch points

Setting Watchpoints

http://help.sap.com/saphelp_erp2005/helpdata/en/c6/617cdce68c11d2b2ab080009b43351/frameset.htm

Changing Watchpoints

http://help.sap.com/saphelp_erp2005/helpdata/en/c6/617ce2e68c11d2b2ab080009b43351/frameset.htm

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

If you need futher information plz do let me know

~~Guduri

Read only

Former Member
0 Likes
6,298

Hi Vijaya..

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.

http://help.sap.com/saphelp_46c/helpdata/en/c6/617cd9e68c11d2b2ab080009b43351/frameset.htm

Read only

Former Member
0 Likes
6,299

hi laxmi ,

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.

<b>debugger contains the watchpoint option in it.</b>.

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.

<b>result</b>

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.

<b></b>

Read only

Former Member
Read only

Former Member
0 Likes
6,298

<b>Hi,

we can say watch points as conditional brreak points depending up on particular

condition it will start executing.

Ex : for example you have 10.000 records record number 7000 is not executing

properly in order to identify the error we need to debug all 6999 records to go to

7000 record in order to overcome this we use watchpoint , by using watchpoint

we can put breakpoint on a particular record and see where it is going wrong .

In order to create watchpoint go to debugging screen there u can find create

watchpoint tab, click on that give the condition</b>

<b>try this</b>

Read only

Former Member
0 Likes
6,298

Hi Laxmi,

I have created a <b>snap shot</b> for every step.Already,I have sent you

these 10 Snap shot to your mail id. After reading each step open the

corresponding file, so that you can understand more clear.

Step1: Here you can see the sample code on Watch points.

step2: In this, switching over to debugging mode.

Step3: Debugging has started.

step4: Here, click on the "Watch point" button.

Step5: Now, You can see one dialog box.

Step6: Here I enter the name of the variable name, where you want to put Watch point. Watch points are same as Break points, but with some conditions.

You can put the watch points in two ways:

a.We can put watch point when there is change in a value i.e.,

whenever the variable holding value is changed during the

execution.

b.Another way is giving some condition.

Ex: Here in this example I have shown you that,when variable

w_num is equal to 5 I am putting the break.

Step7: Here, I am selecting the relative operator for putting the condition.

Step8: Entering the value as 5.Here, the condition that I given is whenever

w_num equal to 5.

step9: After Pressing F8,you can this screen.

Step10: Here you can see that,Your Program execution is stopped at this condition, When w_num = 5.

Hope the above desc. makes you understand crystal clear.If you have any queries, you are welcome.

<b>Reward,if helpful.</b>

Regards,

V.Raghavender.