Software Engineering Fundamentals: Sap Abap: Debugging
Software Engineering Fundamentals: Sap Abap: Debugging
SAP ABAP
Debugging
Copyright 2008 Accenture All Rights Reserved. Accenture, its logo, and Accenture High Performance Delivered are trademarks of Accenture.
Module Objectives
Define debugging
Describe branching to debugging mode
Define key debugging concepts and functions
Explain the debugging mode
Describe examining/changing variables
Identify breakpoints and watchpoints
Debug internal tables
What is Debugging?
Tool used to identify and eliminate errors in
ABAP programs
Allows the verification of program logic in a stepby-step manner by examining the results of
individual statements
Object List
Development object ... ... ...
...
Test/execute
...
Debugging
Program
B170D051
Any screen
Breakpoints
...
Utilities
...
/h
...
Debug ABAP
...
Debugger modes
Examining the value of variables
Changing the value of variables
Setting breakpoints
Setting watchpoints
Viewing contents of internal tables
Debugging Mode
Execute
Continue
Table
Breakpoint
Identifies breakpoints
Watchpoint
Return
10
Setting Breakpoints
Menu:
Utilities
-> Breakpoints
Keyword:
BREAK-POINT
ABAP Editor
Debugging Mode
Breakpoint ->
Create/Delete
Activate/Deactivate
Delete All
Deactivate All
Save
Breakpoint At
Create Watchpoints
11
Watchpoints
Debugging
..
Breakpoint ..
Create/Delete
ABAP Debugger
C
..
Watchpoint
..
..
or
Create Watchpoint
12
Click on Tables tab to take you to the next tab where you can check the contents of table.
13
14
Call Stack
Load the call stack tool. View the sequence of events that have
been processed till it reaches the current breakpoint.
15
Debugging Concepts
Apart form being able to debug an ABAP program in the debugger, you
can also choose the debugger call by choosing a breakpoint. A
breakpoint is a signal at a particular point in the program that tells the
ABAP runtime processor to interrupt processing and start the
debugger.
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 want the program to be interrupted only 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.
Dynamic breakpoints are more flexible than static breakpoints because you
can deactivate or delete them at runtime.
Copyright 2008 Accenture All Rights Reserved.
16
Debugging Concepts
System Debugging:
The System Debugging function enables the user to analyze system
programs, in addition to application programs, using the Debugger. This
function is called or terminated through the menu Settings System
Debugging On /Off. By selecting the menu Settings Save, this predefined
setting is stored to the database and thus activated again each time the new
Debugger is activated.
Update Debugging:
Update function modules do not run in the same user session as the
program that is currently running in the ABAP Debugger. These function
modules are therefore not included in debugging. Only if you select the
Update Debugging option can you display and debug them after the
COMMIT WORK.
If you call an update session during a user session, breakpoints that were
defined beforehand in the calling processing unit are copied to the new
update session, where they can be displayed under Breakpoints. If, in the
ABAP Debugger, you check Update Debugging under Settings and then,
for example, call the update module func using CALL FUNCTION func IN
UPDATE TASK, a new window is opened in which you can debug this
function module in the update session. All the breakpoints that were set in
the calling processing unit can also be processed here.
Copyright 2008 Accenture All Rights Reserved.
17
Duration 20 minutes
18
19