ABAP New Debugger Conditional Breakpoints

By | April 25, 2013 | Concepts | 7,986 | 11

ABAP New Debugger has few more additions to the debugger as well. Since ABAP release 731 which is delivered as part of ECC 6 EhP6 Release 7 EhP6, you can have conditional breakpoints.

Introduction

ABAP Release 731 has new addition in the Breakpoint tab. Now, you can add conditional breakpoints. This would be very useful when ever you would need to debug within LOOP or the code is being called in iterations.

New Debugger – Add Conditional Breakpoint

When you add the breakpoint and execute the application, system would stop at the statement. Once it would stop, you can choose option “Create Breakpoint Condition” from context menu (right click).

Subsequently you would see the popup to enter condition. This is a free text editor where you can write a condition. If the condition would satisfy, debugger would stop at that breakpoint. For entering the condition, you can use the help button on the Popup.

As you can see in this screenshot, it has stopped when it met my condition.

You can also add the Breakpoint using the create Icon in the Breakpoint Tab in Condition column. When you have a condition, it also changes the ICON just to let you know if there is a condition or not.

Use Breakpoint Condition

Currently you can use Watchpoint to watch a single variable. If the value gets changes, debugger would stop mentioning the watchpoint reached.

Think of a situation where you have tens of thousands of records. You want to stop for specific record. Without conditional breakpoint, you would need to find the specific record using the multiple field conditions. With using the Conditional Breakpoint, you can add the condition to the breakpoint to stop the debugger.

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{272 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 272 articles.

Load comments

11 Comments

  • steve oldner

    Just tried it. Very Cool!

    Thanks Naimesh!

  • Abhishek

    This is awesome.
    Will have to wait until I get EnhP6

  • oo.sap.abap

    This is very handy, have used it once before . Thanks for the post !

  • Fawcs

    For “older” versions you won’t have that option on the context menu. You can go straight to the break-points tab and insert the condition there(EnhP2 SP10 here). Tried on 7.01 and didn’t find it

  • coder

    What is “ABAP release 7 ehp6″? Currently I have a sandbox with Netweaver 7.3 EHP 1 (with version of SAP_ABA & SAP_BASIS as “731 0004″). Is this sandbox is ready to deal with conditional breakpoints?

  • Hello coder,

    It should be ABAP release 731 which is shipped with ECC 6 EhP6. I have corrected the article. Thanks for pointing it out.

    Thanks,
    Naimesh Patel

  • Renan Lima

    Hi Naimesh,

    Your blog is very useful, and thanks to your posts i’m learning lots of things regarding ABAP OO.

    Just one observation. I did use watch points a long time ago, and i could do some nice condition verification that were very alike to what you made in this example. My knowledge isn’t very profound about this matter, but something tells me this new resource might be, at least, a bit more powerful.

    Keep up the excelent work.

    Best Regards,
    Renan

  • Hello Renan,

    Glad that I and the site zevolving.com can help.

    You have guessed it correct – This feature is more powerful than creating a watch point as you can mention many more variables and its conditions in this conditional breakpoint vs single variable in watchpoint.

    Thanks,
    Naimesh Patel

  • Gaurav Dixit

    Thanks Naimesh, It is very useful, your articles are as usual very knowledgeable…learning lot from them.Thanks once again.

  • Jeremy

    Hi,Naimesh Patel,
    what’s the difference between ‘watch point’ and ‘conditional breakpoint’?

  • Hello Jeremy,

    I know it sounds same, but there are few obvious difference:

    Watch point is created with reference to a Variable.
    Watch point is also effective to only a program where it was activated

    Where as:

    Conditional Breakpoint can be activated on multiple variables:

     
    ls_t001-bukrs = '1000'
    and ls_t001w-werks = 'ABCD'
    and ls_mara-matnr = 'XYZ'
     

    Conditional Breakpoints are not dependent to any program

    Thanks,
    Naimesh Patel

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.