We can set watch point for object reference but not to object attribute in abap debugger. But using Debugger Script we can do it.
What I would like to explain:
How to set Watch point to object reference attributes.
I created simple class with 3 attributes and one method to set the those values and one report to test.
I want to stop when age is 30.
What needs to be done:
1.Go to transaction SAS click on Script editor and create new script.
write down following code in Script method
Here P_var_name is attribute on which you want to set watch point. So if value is 30 setting watch point by calling method BREAK.
Now you need to load this script in debugger as below.
2.execute programme in debugger mode , in debugger click on script tab,and then click on Load script and give script name which created above.
Then we have to set when this script should trigger. I want to watch age value so I am selecting watch point reached and setting watch point to reference LR_OBJECT.
Then click on Start Script, Programme stops at write .We can see age value is 30.
If we set the age other than 30 programme won’t stop.
You can watch above example through this link.http://www.youtube.com/watch?v=HeaXtgtO2K4
For more details about script http://scn.sap.com/docs/DOC-10249,