Debugging Overview Education Session: A Hands On Experience
Debugging Overview Education Session: A Hands On Experience
Debugging Overview Education Session: A Hands On Experience
Session
A hands on experience…
Course Overview
4 Sessions
Debugging overview
Commands and Tools
Watchpoints and Variables
Tips and Tricks
Each session is followed by an exercise!!!
PAY ATTENTION….
= Time to do it yourself!!!
Session 1 - Overview
In this session you will learn to:
Launch the debugger
Switch between the debuggers
Set a break-point
Session
User
New / Classic Debugger
Classic ABAP Debugger New ABAP Debugger
Runs in the same roll area as the Executed in a separate external
application to be analyzed session (Debugger), while the
(debuggee). It is therefore application to be analyzed
displayed in the same window as (debuggee) uses a second external
the application. session.
However, this technology also has With this technology, the user
some restrictions. interface of the Debugger can be
Can debug conversion exist designed freely by ABAP means.
No ABAP technology can be used
for designing the Debugger
interface and it is therefore not
possible to create a modern user
interface.
Break points
Breakpoints can be created using
the following mechanisms:
ABAP Commands
SELECT
MESSAGE
…
Method
Class -> Method
Function Module
Form
Program -> Form
Exceptions
Class exception
Source code
Program -> Include -> Row number
Firing off a break-point
Title Info – Session / Exclusive
Exclusive
Exclusively occupies a work
process during debugging
Non-Exclusive
Roll-out enforced after each
debugger view => Commit
work
Limited functionality
Select – Endselect
Conversion / field exits
Inconsistent data
Not available in Prod
Break-point – Session, User
Dynamic break-points are set by
double clicking a line in the
ABAP editor (Session Break-
point)
User specific
Removed when logged off
User break-points (previously
known as External or Static
break-points)
Need to use this type of break-point
to debug BSP or Web Dynpro
applications
Valid for all logons to the server by
the executing users
Session 1 - Exercise
Setting break-points
Transaction ZEM1 (ELD 110)
Sold to Customer = 300
Order Creation Date = 12/4/2011
-> 01/03/2012
Check if debugger session is exclusive
or non-exclusive
Switch between new and old debugger
and vice versa
Create a session break-point at the
subroutine SELECT_DATA of program
ZEM_OTC_ORDERSTATUS
Create a user break-point at the CALL
SCREEN 2000 command of program
ZEM_OTC_ORDERSTATUS
Create a normal break-point at line 70
of program
ZEM_OTC_ORDERSTATUS
Session 2 – Commands and Tools
In this session you will learn to:
Understand the debugging commands and tools
Skip iterations in a debug session
Understanding the Debugging Screen
Title Info System Variables
Flow Control Tools
Program info Tabs
Flow Control
Single step - Execute the program statement by statement. This allows you to branch to other
program units (Detailed debugging to view all variables)
Execute - Process a program line by line. All of the statements on the current line are
processed in a single step (Skip the line because you know it’s not an issue)
Return - Returns to the point at which control is passed back to the main program. Use this
option to return from other program units. (Once you’ve single stepped in to code and then
you realize this code is not at fault and you want to get out and continue from the calling
program)
Continue - Process the program up to the next breakpoint. If there are no more breakpoints
in the program, the system exits debugging mode and executes the rest of the program
normally (Continue on to the next break point or let the program commit to the database)
Debugger Tools
4 Tools on 1 page
Different views
Desktop 1
Initial analysis
Standard tabs
Detailed technical analysis
Break/Watchpoints
Navigate through the issue
Debugger Tools
Source code
Call stack
Variables
Breakpoints / Watchpoints
Table
Structure
Data explorer
Loaded Programs (Global Data)
Current session
Memory Analysis
DiffTool –Variable / Structure
comparisons
System Areas
Desktop 1
Watchpoints allow you the option of monitoring the content of individual variables. The Debugger stops as soon as the
value of the monitored variable changes. In addition, conditions can be specified. The Debugger also checks whether such a
condition is fulfilled.
E.g. Conditions:
sy-index > 5
sy-index = sy-tabix
lines( itab ) > 0
lines( itab ) <> sy-tabix
lines( itab ) < lines( itab2 )
strlen( s ) >= sy-index
Watch performance
Increased memory consumption
Only valid in current roll area
Program Info and System Variables