ABAP Debugging HJK
ABAP Debugging HJK
Just like activating debugger with /h in command field, to activate classic debugger enter /hset
debugger=classic and use /hset debugger=standard to activate standard debugger. However, this
will have effect only on the current logon session. Standard debugger will be the default for any new
SAP logon session.
Note: Post SAP release 7.4, Standard debugging has been the only way for Debugging external
requests irrespective of the OK Codes used.
2. Session Breakpoint
3. Persistent Breakpoint
Default tools
Fullscreen – Expand screen & removes all tools but retain the ones in toolbar
Debugger icons explained with the purpose & its keyboard button
• Options available other than the above 4 ways to step through the code
o Continue to cursor – Execute the ABAP code till the cursor position – Press SHIFT + F8
o Goto Statement – Helps in skipping/reprocessing section of source code, without having
to go in a new debugger session. Right click on the ABAP statement from which we want
to execute, choose Goto statement in the dialog menu that pops up.
• Step Size
o If we want to debug the subconditions in the ABAP code. This can help in the following
places,
▪ When we have multiple subconditions in the conditional statements.
▪ When we want to debug every step in VALUE, REDUCE, FOR iterations & similar
ABAP 7.4 & above statements.
• Place the cursor on the statement where we want to have breakpoint, Then press CTRL +
SHIFT + F12 key
• Place the cursor on the statement where we want to have breakpoint, click on in the
toolbar.
• Left click on the status column i.e., left side of the source code line on which we want the
breakpoint in the ABAP editor.
• Session breakpoint can be created in Debugger session also, right click on the source code
line on which we want the Session breakpoint & select the Create Session breakpoint option.
External Breakpoint
External Breakpoints will be active/valid for future user sessions. These breakpoints are valid for 2
hours and whenever a new breakpoint is set, the lifetime of all breakpoints is reset. These breakpoints
are useful when we want to debug applications/ web services that are connected to SAP via RFC &
HTTP request. Also, these breakpoints can be set specific for certain User or a Terminal ID. Following
are the ways to set external breakpoint,
• Place the cursor on the statement where we want to have breakpoint, then press CTRL +
SHIFT + F9 key
• Place the cursor on the statement where we want to have breakpoint, click on in
the toolbar.
• Right click on the Status column, left side of the source code line, Select Create External
breakpoint.
• External breakpoint can be created in Debugger session also, right click on the relevant
statement and choose Create User Breakpoint.
External breakpoints can be set for another user, can be helpful when we are trying to debug RFC
call or HTTP request made by another user. To do this, follow the below steps,
• Click on Utilities in the ABAP editor top menu, then Settings -> ABAP editor tab ->
Debugging. Enter the user for whom the External breakpoint needs to be set.
In cases where the external breakpoint (for another user) needs to be only in the current
application server, Flag the checkbox Current application server only.
Debugger Breakpoint
As the name indicates, these breakpoints can be set only in Debugger session, so they are visible in
debugger session and deleted right after the debugger session ends. Both Session & External
breakpoints can be set on the ABAP statements (Known positions) that is seen on the screen while
Debugger breakpoints can be set on unknown positions as well. We will see how to do this.
Set Debugger breakpoints at a known position
• Right click on the relevant ABAP statement & Choose Create Debugger Breakpoint.
• Left click on the status column i.e., the left side of the line number in ABAP editor, to the left
of the relevant ABAP statement.
• Set the cursor the on the ABAP statement that is of interest, choose Breakpoints -> Line
Breakpoint. We get options to Set/Delete & Activate/Deactivate debugger breakpoint.
This dialog box opens when we press F9 or Create breakpoint. With this, Debugger breakpoints can
• ABAP statements – Breakpoint can be set for all possible ABAP command statements
• Methods of Class (Global & Local).
We should enter the class & method to set a breakpoint for the method. Similarly, if we want
to set a breakpoint for a method of a local class within any specific program.
• Exceptions & Messages of all types – Set breakpoints at all instances of specific exception
class. Also, we set breakpoint for a specific Message of a certain Type (I, E,A,S).
• Include programs & PAI/PBO flow logic of any screen at any specific line numbers – We can
set breakpoint at a specific line in an Include of a Program. Also, Set breakpoint on a line no.
within any PAI/PBO flow logic
Breakpoint Overview
All the Breakpoints that are defined can be seen in within Breakpoint tab in Break/Watchpoints tab
in Debugger session. From this tab, Breakpoints can be created, activated, deactivated & deleted.
Also, we can change the type of breakpoint from here.
We can also set conditions for the breakpoints., if we want the breakpoint (that is already set) to be
triggered only on for a specific condition. Like the below example, if we want the breakpoint to be
triggered only when the user name is ‘PRABHAKARAN’
We can also see the overview of Breakpoint from ABAP Editor.
Watchpoints
Watchpoints are a way to make the debugger stop when the value of the variable/data object (for
which watchpoint is created) changes.
On creating the Watchpoint, we get the below dialog box where we should enter the variable/data
object for which Watchpoint needs to be created.
Below example, Watchpoint is created for variable SY-UNAME with condition SY_UNAME =
‘PRABHAKARAN’. So whenever the value of SY_UNAME changes to PRABHAKARAN debugger will
stop. If we want the debugger to stop whenever the value of the variable changes, then leave the Free
condition blank.
Watchpoints created can be seen in Watchpoints tab under Break./Watchpoint tab in debugger
session. We can also activate, deactivate, create, change, delete any watchpoint from here also.
Following the below steps, Debugger sessions can be saved, loaded for a later debugging session, can
also be deleted if no longer needed along with components that can be chosen.