Sei sulla pagina 1di 16

Debugging concepts

In ABAP Language

02-Sep-09

Kaavian Systems

Debugger
The Debugger is a programming tool that you can use to execute ABAP programs,
by line or by section. With this tool, you can display data objects and check the flow
logic of programs.
During the program implementation the tool can be used to analyze error
situations of the program (dumps, unexpected program behavior).

Two types of debugging are currently possible:


Debugging with the classical Debugger for release levels up to and including
6.40 or debugging with the new Debugger, which is available for all releases after
6.40.

02-Sep-09

Kaavian Systems

Types of debugger
The Classical Debugger
The Classical debugger runs in the same roll area as the application to be analyzed
(debuggee). It is therefore displayed in the same window as the application. However, this
technology also has some restrictions. For example, some ABAP programs (such as
conversion exist) cannot be analyzed in debug mode for technical reasons.

The New ABAP Debugger


The New Debugger is executed in a separate external session (Debugger), while the
application to be analyzed (debuggee) uses a second external session. With this
technology, the user interface of the Debugger can be designed freely by ABAP means.
The new Debugger provides the user with a flexible interface that can be configured as
required and has more than eight desktops.
02-Sep-09

Kaavian Systems

Switching to Debugging Type

02-Sep-09

Kaavian Systems

Start Debugger Session

02-Sep-09

Kaavian Systems

Start Debugger Session

A program is executed, debugging can be switched on as follows:


Executable programs, function modules, methods, or transactions:
Enter /h in the command field or select the menu item System Utilities
02-Sep-09

Kaavian Systems

Debug Screen.
6

Starting Debugger in Abap Workbench


There are two possible strategies for starting the Debugger in the ABAP
Workbench:

By setting breakpoints then running the program


By running the program in debugging mode.
Setting Breakpoints
A breakpoint is a signal in a specific line of the program source code. This signal
indicates to the ABAP runtime processor to stop the program at the relevant line and start
the ABAP Debugger. A distinction is made between static and dynamic breakpoints.

Break Points are : Static Break Point and Dynamic Break Point
There is also a special kind of breakpoint called a watch point
02-Sep-09

Kaavian Systems

Breakpoints and Watchpoints

Breakpoints and Watchpoints


Different kinds of breakpoints allow the developer to mark positions in the
source code. If a breakpoint is reached, the debugger stops, or - if it has not been
displayed yet - the debugger is displayed in an extra main session. A watchpoint is
related to a variable. It is used to stop processing the source code if the variable
value changes in a predefined manner.

Note: Each user may define a maximum of 30 breakpoints.


Breakpoints
Breakpoints can have different scopes and different lifetimes.

02-Sep-09

Kaavian Systems

Types of Breakpoints

Static Breakpoints
Static breakpoints are always user-independent if there is no specification of a user name.
Once a user has inserted the statement BREAK-POINT or BREAK name in an ABAP
program, the system always interrupts the program at that point for that user or only for the
user name. This procedure is only useful in the development phase of an application when
program execution is always to be interrupted at the same place

Dynamic Breakpoints
Dynamic breakpoints are user-specific. Therefore, you should use them if you only want
the program to be interrupted when you run it yourself, not when it is being executed by
other users. All dynamic breakpoints are deleted when you log off from the R/3 System.
02-Sep-09

Kaavian Systems

Setting Various Breakpoints

02-Sep-09

Kaavian Systems

10

Session Breakpoints and External Breakpoints

Session Breakpoints:
Breakpoints are created in ABAP editor. It is valid for a logon session and for all
external modes of this logon session.

User Breakpoints (External Breakpoints):


It is valid for all user logons on the current server of the current system. We can
convert Debugger breakpoints and Session Breakpoints into External Breakpoints
within the debugger. All the External Breakpoints are valid for 2hours only.

02-Sep-09

Kaavian Systems

11

Example

02-Sep-09

Kaavian Systems

12

Example Debugging Screen

02-Sep-09

Kaavian Systems

13

Example Debugging Screen

02-Sep-09

Kaavian Systems

14

End Debugger Session

02-Sep-09

Kaavian Systems

15

THANK YOU

02-Sep-09

Kaavian Systems

Potrebbero piacerti anche