The Classic ABAP Debugger loads in the same session as the program. This poses certain technical challenges for debugging ABAP programs.
It also restricts developing a new UI design for the ABAP debugger. To overcome such challenges, SAP introduced the New Debugger. In this blog post, we’ll look at the UI and tools offered with the New Debugger that differ from the Classic Debugger. We’ll also look at the overall layout and the use of sessions.
User Interface and Tools
The New Debugger provides a feature-rich UI that can be customized to display up to four tools in a desktop. The figure below shows the New Debugger with the UI customized to display different tools that show the source code, an internal table, an object, and variables.
Each tab is called a desktop in the New Debugger, and there are 12 total desktops, with each desktop capable of displaying four tools. Each tool has its own options, as shown in the next figure:
- Various desktops
- Close tool
- New tool
- Replace tool
- Full screen
- Swap tool
- Maximize horizontally
- Services of the tool
Using the available options for the tool, you can load new tools in the desktop, and replace, swap, and maximize the tool. There are also specific services for the tool that can be accessed using the Services of the Tool icon.
Selecting the New Tool option opens a window, as shown in the next figure. As you can see, the New Debugger provides wider tool support than the Classic Debugger. It also provides some special tools, for example, a tool to debug Web Dynpro applications. Select any tool from the New Tool window to add it to the desktop.
The process to run through the code and analyze data objects is similar to that for the Classic Debugger (using the F5 to F8 function keys). Compared to the Classic Debugger, the Create Watchpoint window, apart from variables, allows you to set watchpoints to monitor changes to object attributes.
Choosing Miscellaneous > Debugger Tips will lead you to various tips to use the New Debugger. We recommend that you go through all the tips to feel comfortable using the New Debugger.
Layout and Sessions
You can save the layout of the New Debugger by choosing Debugger > Debugger Session > Save Layout (see below). This option is useful if you’ve customized the desktop layout with different tools and want to use the result as your default layout.
You can save the current debugging session by choosing Debugger > Debugger Session > Save. This will open the Save Current Debugging Session window, as shown below. You can save the current debug session to a file or to a database by selecting the relevant radio button and providing a name for the session. Optionally, you can also add a comment to identify a saved session easily.
Different components of the session, such as layout, breakpoints, watchpoints, settings, options and variables, can be saved (see figure above). You can load a saved session by choosing Debugger > Debugger Session > Load, view the saved sessions and delete them by choosing Debugger > Debugger Session > Overview/Delete, and change the names of the desktop tabs by choosing Debugger > Debugger Session > Designation of the User Desktop.
Because the New Debugger opens in a new session, when the application being debugged is ready for input, the external debugger session remains open, and the application screen is presented to the user for input. If any further breakpoint is reached, the debugger loads automatically. This ensures that the debugger doesn’t lose any layout changes or tool arrangements set previously.
To close the external debugger session when the control is returned to the application, use the /hx command in the command bar of the application screen. The debugger can be turned on from any transaction screen using the /h command in the command bar of the SAP GUI screen.
Editor’s note: This post has been adapted from a section of the book Complete ABAP by Kiran Bandari.