ABAP Debugging Tips and Tricks
ABAP Debugging Tips and Tricks
Table of Contents
Debugging Tips and Tricks ............................................................................................................................ 3
Finding event handlers .............................................................................................................................. 3
Using Classic debugger ............................................................................................................................................... 3
Using New debugger.................................................................................................................................................... 4
Skip breakpoints ........................................................................................................................................ 4
Script recording and playback .................................................................................................................... 5
Check sorting before READ BINARY SEARCH.......................................................................................... 6
Debug RFC calls ....................................................................................................................................... 6
Scenario 1: Calling a custom RFC FM ......................................................................................................................... 6
Scenario 2: Calling a Standard RFC FM ...................................................................................................................... 6
Debugging a Popup Window...................................................................................................................... 7
External breakpoints .................................................................................................................................. 8
Saving breakpoints .................................................................................................................................... 8
Update debugging ..................................................................................................................................... 9
VMC Java debugging ................................................................................................................................ 9
Miscellaneous............................................................................................................................................ 9
Related Content .......................................................................................................................................... 10
Disclaimer and Liability Notice ..................................................................................................................... 11
Double click on the variable to reach the Object/Class display section, now click on the Events button ,
this displays a list of events raised by the class and their corresponding handlers.
Skip breakpoints
The new ABAP debugger gives an option to skip the first n occurrences of a breakpoint; this would be useful
while debugging loops as we might want to skip the first n executions of the loop. Or the first n times a
function module / subroutine is called. The below screen shot shows where we can enter the number of
times the breakpoint should be skipped.
Note: The breakpoint tool can be displayed either by adding it as new tool or navigating to the Break/Watchpoints tab.
Note: Scripting has to be enabled on your SAP system for this to work. Enabling scripting on a production system is
NOT recommended.
Before delivering the code, we can use this option to make sure all internal tables are properly sorted
before READ BINARY SEARCH is performed on them. If the table is not sorted a runtime error is generated.
This ensures that the READ statement does not return incorrect results.
Method 1: For this create a text file (say debugger.txt) on your desktop, and type the below lines into the file:
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
Now drag the file onto the popup window / information message and debugging is enabled!
Method 2: From any SAP windows press the Customize Local Layout button (Alt + F12) and select
Create Shortcut in the window that appears make the below changes and click Finish. A file is
generated on your desktop or SAP workspace. Now drag the file onto the popup window / information
message and debugging is enabled!
External breakpoints
In order to debug ABAP code which is called via Portal or any external system you can need to follow a two
step approach. Firstly enter the user ID using which you would login to the portal / HTTP application, this
can be done in on of the workbench development utilities (SE38, SE37, SE80, etc) choose Utilities
Settings Debugging External Debugging. Secondly set external breakpoint at the required position
in the ABAP code using the Set/Delete External Breakpoints button. Now when the external application
is run the ABAP debugger opens in a separate window. More details can be found here.
Saving breakpoints
If you need to debug the same code again and have a set of breakpoints in place, you can create a Session
to save the breakpoints and settings. Later this session can be loaded by any user, and the same set of
breakpoints is restored.
Path: New Debugger: Debugger -> Debugger Session -> Save
Classic Debugger: Debugging -> Sessions
Update debugging
We might want to debug an Update Function module, but these do not run in the same user session as the
debugger, hence they cannot be debugged directly. If we enable the Update debugging option then a
separate debugging session opens after COMMIT WORK. This is useful in debugging update terminations.
Path (classic debugger): Settings tab
Path (new debugger): Use the menu path: Settings -> Display/Change Debugger Setting
Miscellaneous
There are lots of other features to explore such as:
1. Memory inspector.
2. Activatable checkpoints.
3. Performance Analysis.
4. Update management (SM13).