Skip to Content

SAP NetWeaver 7.0 EHP2 brings an expanded set of breakpoint and watchpoint capabilities as well as a new higher-resolution statement debugging capability (of course in the New ABAP Debugger!).

This blog shows how to use these new features:

  • The new types of breakpoint (on ABAP command, on Web Dynpro entities, on method of a class, on Simple Transformations…)
  • The new types of watchpoints (on internal table, on ABAP objects and object attributes…)
  • The new conditional breakpoints and watchpoints

This blog also explains the new statement debugging in ABAP – how you can separately debug multiple ABAP statements or expressions in one line.

If you are interested in a live demonstration of the new features in ABAP breakpoints and watchpoints, just take a look at this short video:

 

 

 

1.  New Breakpoint Types

If you are in the New ABAP Debugger and press the Breakpoint button,  you will find a whole series of new tabs in the breakpoint popup. Each of these tabs introduces a special new breakpoint type, which you can choose accordingly to your special needs, when setting a breakpoint in your code. Let’s take a closer look at some of them.

 

ABAP Command Breakpoints

With the ABAP Cmnds tab, you can set a breakpoint on any of a variety of ABAP statements, shown to you in the F4 Help. The possibilities include setting a breakpoint at CALL FUNCTION, CALL FUNCTION DESTINATION, CALL FUNCTION IN REMOTE TASK, CALL FUNCTION IN UPDATE TASK, …. Many people didn’t know that there are also different DELETE variants: DELETE ITAB (delete from an internal table) is different from DELETE DBTAB (delete from a database table).

 

 

Method Breakpoints

With the Method tab, you can set a breakpoint at the invocation of a method of a class.

 

 

Simple Transformation and Web Dynpro Breakpoints

On the ST Template tab, you can set a row breakpoint at the call to a Simple Transformation template.

With the Web Dynpro tab you can set a breakpoint on Web Dynpro entities. When entering components, controllers and methods, the name of the generated class is determined and the breakpoint is set there. You can also tell the debugger to stop at each ABAP stack and screen change (Misc tab) or set a breakpoint on a message (Message tab).

 

 

 

2.  Conditional Breakpoints

Imagine you need to debug an ABAP application in which an internal table is gradually filled  with a large number of data records. Somewhere during the execution an error takes place and an incorrect data record gets inserted into the table. To analyze this behavior you can tell the debugger to stop as soon as this incorrect data record gets inserted into the table. You can do this by setting a breakpoint and adding a condition to it.

To add a condition to a breakpoint, click on your breakpoint with a right mouse button and choose Create Condition from the context menu. An additional popup is displayed, in which you can enter the test condition. You can use variables in the condition, as well as debugger symbols and functions. Use the F1 Help on the Breakpoint Condition popup to see the possible condition operands and syntax.

 

 

3.  New Features in Watchpoints

Now it is possible to set a watchpoint for an internal table (this wasn’t possible in the classic debugger).  Just press Watchpoint button and enter the internal table name in the Create Watchpoint popup. The debugger stops when the internal table is changed. You can further refine the watchpoint by specifying a condition (for example stop only if internal table contains more then 200 rows). Enter a condition in the Free Condition Entry field.  Use the F1 help to learn which functions you can use in your conditions. The debugger will stop only if the internal table has changed and your specified condition is fulfilled.

In addition, the Break./Watchpoints tab shows which watchpoint has a hit, and you can for example view and compare a variables in its current (after stopping at a watchpoint) and previous state.

 

 

A further new feature is the ability to set watchpoints on objects. Just enter the object name in the Create Watchpoint popup. In this way you can monitor the object during execution of your program.  The debugger will stop as soon as the object changes. You can also set a watchpoint at object attribute (choose Watchpoint at Object Attribute  radio button)  and select any desired types of instance and static attributes.  The debugger then stops if an attribute has changed. Afterwards you can take a look at this attribute change on the Break./Watchpoints tab  by selecting your watchpoint there and clicking on its details magnifier (in our example the ‘Expander’ attribute has changed from ‘X’ to a ‘space’).

 

 

4.  Statement Debugging

Now imagine you are stepping through your code in the  debugger and execute a long IF… statement, consisting of many different subcondtions. You expect a positive result, but unfortunately the IF… statement delivers you the negative answer. To analyze this behavior you need to understand which subcondition of this long IF…statement failed.

You can  easily evaluate the conditions in the IF by changing the step size in the debugger. By pressing the Step Size button you activate the statement debugging, and the debugger will execute the subconditions of for example your long IF… statement separately one after another. You can then analyze return values of single subconditions on the Auto tab of the variable fast display window. By pressing the Step Size button again you return to a normal line stepping in the debugger.

 

To report this post you need to login first.

28 Comments

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

  1. Wilbert Sison
    This is cool! I quite like the conditional breakpointing capability.  In our version, I noticed that the debugger is capable of Dynpro break-points which I found rather nasty in earlier versions. Not sure that improvement was earlier than EHP2 but it’s nice to know SAP’s putting an investment on good old developer tools.
    (0) 
  2. Martin Maruskin
    HI Olga,

    thanks for keeping us up to the with the newest development in new debugger area. Do be honest I do not think that new debugger even on releases like 7.0 is matured enough. E.g. I encountering a bug while trying to search for values in internal table. Simply search doesn’t work 🙂
    Anyway I try to find a way I would I report this to SAP officially.

    Rgds, Martin

    (0) 
  3. Sandra Rossi
    Hi Olga, hi everyone,

    I see that we have finally the list of possible ABAP commands, could someone be gentle enough to paste the list from EHP2 so that we can use them in older releases (I just discovered thanks to Olga that on my 7.0 system, “INSERT ITAB” allows to stop at each insert on itab, and “INSERT DBTAB” is for database, there are “MODIFY DBTAB”, “DELETE ITAB”, etc. nice! but not “DELETE DBTAB” by the way…)

    Thank you community for your help! 🙂
    Sandra

    (0) 
  4. Rajesh Paruchuru
    It would be nice if the new debugger supports
    the feature of linking the watch points with ‘AND’ condition…(classical debugger has this capability)is this already supported? and I thought the watch point on an internal table was already introduced in previous releases.

    -Rajesh.

    (0) 
    1. Olga Dolinskaja Post author
      Hi Rajesh,
      you can define free conditions for watchpoints in the “Free Condition Entry” field (see the blog part about watchpoints for a picture).

      Best regards,
      Olga.

      (0) 
  5. Ravin Joshi
    Actually, earlier debugger of SAP was having some limitations but in this new ABAP debugger many of them removed and it’s really nice while using it. Only one limitation I realised while using it as after opening some sessions of same client, it will go to classic debugger mode automatically and will not allow you to switch to new debugger mode until you close some unnecessary sessions. Eventhough, it’s really nice.
    (0) 
    1. Olga Dolinskaja Post author
      Hi Ravin,
      yes, the standard limitations for the maximum number of open sessions per user (6 sessions) are still valid. The new debugger requires always its own session.

      Best regards,
      Olga.

      (0) 
      1. Sandra Rossi
        6 was the limit before 7.0, but 16 is now possible provided that you change the default limit of 6 in profile parameter rdisp/max_alt_modes

        BTW, I’ll ask in the forum if someone can paste the possible names for “breakpoint at”.
        Sandra

        (0) 
  6. Aditya Niyogi
    These are some nice features, however I am still unclear weather the breakpoint for screen debugging has been introduced or not.

    I still see the same message while trying to debug screens.

    Thanks,
    Aditya

    (0) 
    1. Olga Dolinskaja Post author
      Hi Aditya,
      yes, you can set a breakpoint for screen debugging on the “Srce Code” tab in the “Screen” section (enter screen number, line).

      Regards,
      Olga.

      (0) 
  7. Madhu Vadlamani
    it is good one to see features in new debug.We are having EHP4. But i did find the features what you show.Is there components need to be installed.

    Regards,
    Madhu.

    (0) 
    1. Olga Dolinskaja Post author
      Hi Madhu,
      from application perspective, you need to apply EHP5 (Business Suite Innovations 2010). EHP5 is technically based on SAP NetWeaver 7.0 EhP2.

      Best Regards,
      Olga.

      (0) 
  8. Mohaiyuddin Soniwala
    These are really nice features introduces to make our life easier.
    I am also waiting for “Debug as you code” functionality…Any updates when this will be introduced?

    Thanks,

    Regards,
    Mohaiyuddin

    (0) 
    1. Olga Dolinskaja Post author
      Hi Mohaiyuddin,
      do you mean the capability to change your source code on the fly in the editor while you are debugging and and let debugger automatically debug the changed code? If it is so, then this capability is not planned.

      Best Regards,
      Olga.

      (0) 
  9. Yellappa Madigonde
    It is nice to see the new feature. I have been waiting for one option where we can upload data into internal table during debugging. Currently we can save internal table record to local file. Any idea of implementing this feature…

    Cheers,
    Yellappa.

    (0) 
  10. Jim Wells
    I really believe SAP has answered every one of my debugger dreams, and the explanation is clear and concise. A fantastic job by both the people making the debugger and the documentor!
    (0) 
  11. Günter Schepers
    Hi Olga,

    thanks for this interesting news which i really would like to use. We use a SAP Netweaver 7.02 EhP4 but i can’t see all the TABs you describe. Do i have to activate them or do you know the reason why i can’t see them?

    Thanks for any help
    Günter

    (0) 
    1. Olga Dolinskaja Post author
      Hi Günter,
      you need to apply Business Suite Innovations 2010 EHP5. If you use Business Suite EHP4 you will not be able to see these fetaures. Only EHP5 is based on NetWeaver 7.0 EhP2.

      Best Regards,
      Olga.

      (0) 
  12. Ray Mannion
    Thank you for the excellent article!
    Is there a way currently to set a watchpoint when the value in a single field within an internal table is changed?

    Frequently, I’ll be debugging a sales order and want to know when XVBAP[6]-NETWR is changed, but the debugger doesn’t permit this?

    It let’s me watchpoint the entire internal table XVBAP[] but not a specific value?

    (0) 
  13. Shai Sinai

    Hi,

    This is a very useful post. Thanks for it.

    It seems that there were some major improvements in the debugging area.

    I think that there is one useful feature that is still missing: It would have been nice to be able to create watchpoints for internal tables with a free condition for the last added record: Many times we need to track after addition of specific record (according specific criteria). As described in your video demonstration, currently this can be done, but it is little more complicated as you first need to analyze the whole internal table, afterwards use the lines() option in the free condition and then restart the program.

    Please consider it in future releases.

    Best regards,

    Shai

    (0) 
  14. SAPEKSH GUPTA

    Hi Olga,

    Excellent article.

    However, I want to know if its somehow possible to put a watchpoint on STATICS variables. In one of my codes, I am noticing that the value of a static variable (in an FM which is called inside a loop ) is getting changed to an unpredicted value for a particular record. For rest of the records, its working fine.

    I tried putting a WP on it but its not stopping anywhere and the value is still getting changed.

    Could you please suggest me anything in this regard ?

    Thanks & Regards,

    Sapeksh

    (0) 

Leave a Reply