Skip to Content

Hi Friends,

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.

My Example:

I created simple class with 3 attributes and one method to set the those values and one report to test.

Capture.PNG

Capture.PNG

Capture.PNG

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

Capture.PNG

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.

Capture.PNG

Capture.PNG

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.

Capture.PNG

Capture.PNG

Then click on Start Script, Programme stops at write .We can see age value is 30.

Capture.PNG

Capture.PNG

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,

http://scn.sap.com/docs/DOC-10250

Regards,

Sreenivas.


To report this post you need to login first.

11 Comments

You must be Logged on to comment or reply to a post.

    1. Manish Kumar

      Hi Suhas

      The images are clear and sharp once we click on it.

      Jive is downsizing the image when it’s width crosses certain threshold.

      To improve user experience, OP can use screenshot tool to capture only relevant portion of screen that is small enough to fit in Jive layout without downsizing.

      (0) 
      1. Suhas Saha

        I know that. Perhaps i should have rephrased my suggestion as – “Please put screenshots which capture relevant portions only”.

        Thanks,

        Suhas

        (0) 
        1. Manish Kumar

          Of course you know that. I meant to spell it out for the OP.

          I saw a blog/doc recently that had full-size images, 3/4th of which was white color.

          User had probably cropped the image in MS Paint, but didn’t take care of drawing area.

          (0) 
    2. Sreenivasa Rao Yarru Post author

      Hi Suhas,

      While writing this blog abap learners in my mind .So I wanted to give as much information as I can.Because of that I captured full screens, so as Manish explained it is not clear.

      Regards,

      Sreenivas.

      (0) 

Leave a Reply