Sunday, January 29, 2012

How to create Watchpoint during Debugging


               Watch points are one of the best features available during Abap debugging.Watchpoints are used when you would like to monitor the change in a certain variable/variables and if needed on specific conditions.It comes handy when you are processing a larger program or a very large internal table loop.

               Debugging manually to find about a particular change in a variable in large programs can be easily solved by watchpoint.Another way of using watchpoint is when you would like to see or start debugging from a  section where a particular content is found to have a particular condition or value.The debugger would stop at the statement where the content of the variable changes.One can use watchpoints for global and local variables and as well create more than one watchpoint in a program.

Please note 2 major points to remember while creating watch point

      Creating a watchpoint for an internal table can cause performance issues and lead to incease in memory consumption.This is because when you create a watchpoint, actually a clone of the data object is also created .Multiple watchpoints also could cause performance issues if any or all the objects are having large entries.
      Create watchpoint after the data declarations section.Otherwise the variables might not be recognized and thus do not allow in creation of watchpoints.

How to create a watchpoint.
    Create the watchpoint in the debugging mode as shown below.As an example , we are checking for the value of variable result and as soon as you hit “F8”,it stops where the first change of content in the variable “result” is found.





Creating watchpoints is easy .It certainly helps in saving time and effort during debugging .

No comments:

Post a Comment