By
Prasanna Balaji K
27.12.2012
(Version 1.0)
Reviewed By : Sathish Subburaj
Easy Steps of De-bugging
ABAP Debugger
• ABAP Debugger is a tool used to execute and analyze programs line by line.
• Using it we can check the flow logic of a program and display runtime values of the variables.
• By setting breakpoints, we can stop a program during its execution and this will display the contents of the table and variable being used by the program.
• A maximum of 30 breakpoints can be set in the ABAP debugger.
Types of Debuggers
Classic ABAP debugger• The Classic ABAP Debugger, with its old user interface and
its limitations to debug certain types of ABAP program is now not in use by many new and old ABAP developers.
New ABAP debugger• The New ABAP Debugger, with its state of the art and
flexible user interface, can be used to debug all types of ABAP programs. It provides many new features which improve our efficiency of debugging, both in ABAP support and development
Certain ways to get into debugger
Certain ways to get into debugger
Ways to Get Into The Debugger
1) In the ABAP Editor (SE38)
On the initial screen:• Enter the program
name.• Choose Program-
>Execute->Debugging .
Ways to Get Into The Debugger
2) In the ABAP Editor (SE38)
In the source text display:• Choose Program->Test-
>Debugging .
Ways to Get Into The Debugger
3) In the Object Navigator (SE80)
• Select the program to be tested with a double-click.
• Program->Test->Debugging
Ways to Get Into The Debugger
4) In the Object Navigator (SE80)
• Select the Function Module to be tested with a double-click.
• Function Module->Test-> Function Module Test->Debugging
Ways to Get Into The Debugger
5) In the Object Navigator (SE80)
• Select the Method to be tested with a double-click.
• Method->Test/Execute->Execute Method->Debugging
Ways to Get Into The Debugger
6) In the transaction maintenance (SE93)
• Enter a transaction code.• Choose Transaction
Code->Test->Debugging .
Ways to Get Into The Debugger
7) In the job overview (SM37)
• Select an inactive job.• Enter jdbg in the
command line of the system function bar.
Ways to Get Into The Debugger
8) In the ABAP Editor (SE38)
• In the main window of an application, you can enter ‘/h’ in the command field of the system function bar.
• You can also select relevant options in the menu bar.
How to reach into particular loop (Watch point with condition)
• The Create watchpoint dialog box appears when the pushbutton ‘Create watchpoint’ is clicked.
• Enter the program and the name of the field for which you want to set the watchpoint.
• Now the program will stop when the condition specified in watch point is reached.
Table Configuration
• Internal table contents will be displayed by clicking on ITAB.
• Click settings button to configure the table.
• Fields displayed can be rearranged with arrow buttons as shown in the figure.
• Also fields can be suppressed from display.
How to find the route path of the cause ( using Desktop 2 )
• Desktop 2 tab will display all the event types such as method, function, form & modules used in the program.
• Also it displays inside which Include & program the event has been used.
Statement Debugging
• By pressing the Step Size button you can activate the statement debugging.
• ‘Step size’ is used to find which condition got failed in the statement.
Statement Debugging
• The debugger will execute the sub conditions of long IF statement separately one after another.
• By pressing the Step Size button again you return to a normal line stepping in the debugger.
Fastest way to skip the code using F5,6,7,8
• F5 - Step by Step debugging
• F6 - Skips loops and Subroutines
• F7 - Skips the loop or subroutine and returns to the last cursor point.
• F8 - Execute and come out of debugging
Navigate to source code & view
• There is an option for navigate to editor in Breakpoint tab.
• By clicking this, it will navigate to the program where breakpoint is set.
• And a message will be displayed as ‘New window opened for source code display’.
Altering Table Content
• If we want to add a data to the table or alter table content while debugging, Services of the tool can be used.
• It consists of many services.
• We can select the option in which our table has to be altered.
Debugger Scripting
• Debugger scripting helps to trace and implement our own custom breakpoints and watchpoints.
• Select script tab->Load Script->Enter Script name in pop up window.
• Select statement where and all breakpoints has to be set.
Debugger Scripting
• For example, if we want to set breakpoint on particular keyword such as SELECT, DELETE, MODIFY etc which is used in multiple lines of the program, it requires time if we set line by line.
• So in this case, we prefer DEBUGGER SCRIPTING. It has the option to set breakpoints on all script used in the program.
Finding Error Message Stack
• Take a message id details of an error message displayed during program execution.
• In debugger screen, Goto breakpoints-> breakpoint at-> breakpoint at message.
• A pop up window shown in the figure will be displayed.
• Enter message id details-> Enter, it will take you to the program line where error occurred.
Debugger Variant
• Once we sign off the session, the breakpoints we set will get deleted.
• So we can save breakpoints by Debugger->Debugger session->save.
• This will exist till we delete the breakpoints manually.
Skip Breakpoints
• Inside Breakpoint tab, there is an option to skip breakpoints.
• Breakpoints will be skipped with the counts in skip counter.
• If skip counter is left blank, it won’t skip any breakpoints.
Debugging A Pop Up Window
• A pop up window cannot be debugged using ‘/h’ command or by selecting any other menus.
• So click and drag a txt file into the pop up window with the functions shown in the figure.
How to end the debugging
• Enter ‘/hx’ in the command field to end debugging.
Thank You
Thank You