You are on page 1of 20

ABAP Debugger

ABAP Debugger
The ABAP Debugger is an integrated test tool within the ABAP Workbench. You use it to check
the program logic and to find errors in the source code of an ABAP program. In the Debugger,
ou can step through the source code of a program. The running program is interrupted after
each step, allowing ou to check its processing logic and the results of indi!idual statements.
As of "elease #.$%, ou can also run Business Server Pages &B'P( in the debugging mode.
You can also displa and set breakpoints here. Business 'er!er Pages can be displaed in the
Object Navigator when ou select an appropriate application under B'P Application.
Features
The Debugger pro!ides an efficient means of identifing errors in ABAP programs. It contains the
following functions)
Was of starting the Debugger
*hoosing different !iews
*hoosing different e+ecution options in the Debugger
Displaing source code in the Debugger
'etting and deleting breakpoints
'etting and deleting watchpoints
'topping a program at a particular statement or e!ent
Displaing and changing field contents at runtime
Displaing ABAP ,b-ects and references
Displaing and positioning strings
'etting and deleting database locks
,pening the ABAP .ditor, or ,b-ect /a!igator
'stem settings and runtime warnings
Starting the Debugger
There are two possible strategies for starting the Debugger in the ABAP Workbench)
B setting breakpoints then running the program
B running the program in debugging mode.
Setting Breakpoints
A breakpoint is a signal in a line of code that tells the ABAP runtime processor to interrupt the
program at that line and start the ABAP Debugger. A distinction is made between static and
dnamic breakpoints. 0or further information about the different tpes of breakpoints and how to
use them, refer to Breakpoints.
Running a Program in Debugging Mode
You can start the Debugger without pre!iousl ha!ing set breakpoints. This is the best procedure
to use when ou want to test a program right from the beginning. It is also useful if ou do not
know the program !er well and therefore are not sure where best to set breakpoints. You can
start the Debugger as follows)
0rom the Object Navigator 'elect a report or transaction and program and choose Program
Test Debugging.
0rom the ABAP Editor *hoose Program Execute Debugging &or the Debugging
pushbutton(.
From an screen *hoose System Utilities Debug ABAP.
From an screen .nter 1 !h 1 in the command field.

"hecking Sstem Programs #or Errors
To check a program or program component that is part of the ABAP Workbench &for e+ample, the
'creen Painter(, ou must use the sstem Debugger. To start the sstem Debugger, choose
ABAP Training Page 1 of 20
ABAP Debugger
System Utilities Debug system from an screen. To stop the sstem Debugger, choose
Debugger Debugging off.
Disp$aing Program Attributes
You can displa the attributes Fi%ed point arithmetic& Sstem program and 'nicode checks
active of the program that has -ust been e+ecuted b choosing Goto Further Information
Program Attributes.
Disp$a Modes in the Debugger
When ou are debugging a program, there are !arious displa modes that ou can use. All of the
displa modes ha!e the same structure. The top part of the screen displas an e+tract of the
program source code. The bottom part displas the information specificall a!ailable in that
displa mode. There are also pushbuttons on the screen allowing ou to switch to the most
fre2uentl3used displa modes.
ABAP Training Page 2 of 20
ABAP Debugger
Disp$a Modes Avai$ab$e 'sing Pushbuttons
Fields The scrollable field displa contains the contents of up to eight fields. The
contents of the three most important sstem fields are alwas displaed. This is
the default displa mode in the Debugger. 'ee also Processing 0ields
Table Displas the contents of an internal table. This mode allows ou to displa and
edit the entries in an internal table. 'ee also Processing Internal Tables
Breakpoints A scrollable displa containing up to 4% breakpoints. /e+t to each breakpoint is a
counter. You can also delete breakpoints in this displa. 'ee also 5anaging
Dnamic Breakpoints
Watchpoints You can set a watchpoint for a field so that the program is interrupted whene!er
the !alue of that field changes. This displa mode contains a list of watchpoints,
the fields and programs to which the are assigned, the current !alues of the
fields, and the conditions upon which the watchpoint is acti!ated. 'ee also 'etting
Watchpoints
Calls This mode displas the current se2uence of e!ents, and the se2uence of calls up
to the current breakpoint. The last acti!e call is displaed at the top of the list6
pre!ious calls are listed in re!erse chronological order. When an e!ent &for
e+ample, 'TA"T3,03'.7.*TI,/( concludes, it is deleted from the displa.
Overview This mode displas the structure of the program. It lists its e!ents, subroutines,
and modules, and shows which sections belong to which e!ents. It also displas
the section currentl being processed.
Settings This mode displas the current Debugger settings. You can change the settings
b selecting or deselecting !arious options. 0or further information, refer to
'ettings and Warnings
Other Disp$a Modes
You can access other displa modes b choosing Goto Display ata ob!ect.
Single field Displas the contents and technical attributes of a field.
Structured
field
Displas the components of a structure, along with their contents and
attributes. If ou double3click a component, the sstem displas detailed
information for it.
Strings Displa the content and current length of the string. You can also displa
part of the content b means of offset and length.
Internal table Displas the tpe, line numbers and contents of an internal table.
Object Displas the structure of an ABAP ,b-ect.

For further information on these displays, refer to Displaying Attributes and Displaying
ABAP Objets
ABAP Training Page ! of 20
ABAP Debugger
Breakpoints
Instead of starting an ABAP program directl in the Debugger, ou can also debug a program b
creating one or more breakpoints in the program. 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. The program runs normall until the breakpoint is reached.
There is also a special kind of breakpoint called a watchpoint. When ou use watchpoints, the
Debugger is not acti!ated until the contents of a particular field change. 0or further information,
refer to Watchpoints.
Breakpoint (ariants
The Debugger contains different breakpoint !ariants)
Static The B".A83P,I/T statement in an ABAP program. 'tatic
breakpoints are not normall user3specific. 9owe!er, ou can
make them user3specific.
Direct$)set
dnamic breakpoints
*an be set in the ABAP .ditor or the Debugger. Dnamic
breakpoints are alwas user3specific, and are deleted when
ou log off from the ":4 'stem.
Breakpoint
at statement
The Debugger stops the program directl before the specified
statement is e+ecuted.
Breakpoint
at subroutine
The Debugger stops the program directl before the specified
subroutine is called.
Breakpoint at #unction modu$e The Debugger stops the program directl before the specified
function module is called.
Breakpoint at method The Debugger stops the program directl before the specified
method is called.
Breakpoints at sstem
e%ceptions
The Debugger stops the program directl after a sstem
e+ception, that is, after a runtime error has been intercepted.

'se
Static Breakpoints
'tatic breakpoints are not normall user3specific. ,nce a user has inserted a B".A83P,I/T
statement in an ABAP program, the sstem alwas interrupts the program at that point. You
should onl use static breakpoints during the de!elopment phase of an application. You should
set static breakpoints whene!er more than one programmer is working on the same program and
ou alwas want to stop the program in the same place.
Dnamic Breakpoints
Dnamic breakpoints are user3specific. You should, therefore, use them when ou onl want the
program to be interrupted when ou run it ourself. All dnamic breakpoints are deleted when ou
log off from the ":4 'stem.
Dnamic breakpoints are more fle+ible than static breakpoints, because ou can deacti!ate or
delete them at runtime. The ha!e the following ad!antages)
You do not ha!e to change the program code
You can set them e!en when the program is locked b another programmer
You can define a counter &for e+ample, onl acti!ate the breakpoint after it has been reached fi!e
times(.
Specia$ Dnamic Breakpoints
'pecial dnamic breakpoints are useful when ou want to interrupt a program directl before a
particular ABAP statement, a subroutine, or an e!ent, but do not know e+actl where to find it in
the program code. .!ent here is used to refer to the occurrence of a particular statement, for
e+ample, or calling up a method. 'pecial dnamic breakpoints are user3specific. You can onl set
them in the Debugger.
ABAP Training Page " of 20
ABAP Debugger
*rans#erring Breakpoints to +**P and 'pdate Sessions
If an 9TTP or update session is called from a 7ogical ;nit of Work &,'-(, new work processes
are started for these new sessions. Breakpoints that were defined beforehand in the calling 7;W
are copied to these sessions where the can be displaed under breakpoints.
If, for e+ample, the update module #unc is called !ia "A,, F'N"*.ON #unc .N 'PDA*E *AS/,
the new work process is displaed in a second window if Upate ebugging was selected under
Settings in the debugging mode. All the breakpoints that were set in the calling 7;W can then be
processed here.
Static Breakpoints
You should onl use static breakpoints during the de!elopment phase of an application. You must
remo!e them from our program before ou transport it.
Setting Breakpoints
To set a static breakpoint, use the ABAP statement BREAK-POINT . Place the breakpoint in the
line at which ou want to interrupt the program.
program RSDEB'01234
4444
i# S5)S'BR" 67 24
break)point4
endi#4
4444
When ou run the program, the runtime processor interrupts it when the breakpoints occur. You
can number our breakpoints to make them easier to identif & BREAK-POINT 1, BREAK-
POINT 2 <(.
'tatic breakpoints are not normall user3specific. The program is, therefore, alwas interrupted as
soon as the runtime processor reaches the line containing the breakpoint. The program is
interrupted regardless of the user who e+ecutes it.
9owe!er, ou can set user)speci#ic static breakpoints using the BREAK statement followed b
our user name. 0or e+ample, if ou use the statement BREAK SMITH , the program is onl
interrupted when user 'mith runs it. Although user3specific breakpoints appear in the program
code, the are not acti!e when other users run the program. You should, howe!er, be careful if
an application is being used b se!eral users with the same name.
De$eting Breakpoints
'ince static breakpoints appl to all users, ou must remo!e them from the program once ou
ha!e finished testing it. In the ABAP .ditor, ou can find breakpoints 2uickl b choosing Utilities
Global search. You can also use the .+tended Program *heck to find them.
If ou do not remo!e static breakpoints from our program, the will be transported to our
production sstem. This could cause serious problems in the production sstem.
Dnamic Breakpoints
You can set up to 4% dnamic breakpoints without changing the program code. Dnamic
breakpoints can be set either in the ABAP .ditor or directl in the Debugger.
Setting Dnamic Breakpoints in the ABAP Editor
You can set dnamic breakpoints in the ABAP .ditor regardless of whether ou are in displa or
change mode. You can also set breakpoints directl from within the Debugger at runtime. To set
a dnamic breakpoint in the ABAP .ditor)
$. Position the cursor on the line of the source code at which ou want to set the breakpoint.
=. *hoose Utilities Brea"points Set or the 'top icon. The sstem confirms that the
breakpoint has been set.
To displa a list of all dnamic breakpoints in a program, choose Utilities Brea"points
Display. You can use this list to na!igate to a particular breakpoint or to delete one or more
breakpoints from the program.
Setting Dnamic Breakpoints in Debugging Mode
To set a dnamic breakpoint in the Debugger)
ABAP Training Page # of 20
ABAP Debugger
$. Position the cursor on the line in which ou want to set the breakpoint.
=. 'elect the line b double3clicking it or choosing Brea"point Set#elete.
The sstem sets the breakpoint, and displas a small stop sign to the left of the rele!ant line. If
the line alread contained a breakpoint, it is deleted.
When ou finish our debugging session, the breakpoint is automaticall deleted unless ou ha!e
e+plicitl sa!ed it.
Breakpoints at Statements
You can use this special kind of dnamic breakpoint to interrupt a program directl before an
ABAP statement is processed.
Prere8uisites
You must alread be running the program in the Debugger.
Procedure
To set a breakpoint at an ABAP statement)
$. $hoose Breakpoint Breakpoint at Statement...

=. .nter the ABAP statement.
The sstem sets a breakpoint at all points in the program at which the ABAP statement occurs.
4. *hoose ENTER.
The breakpoint applies to all lines containing the specified statement.
Resu$t
The sstem confirms the breakpoint and adds it to the list in the displa. When ou finish our
debugging session, the breakpoint is automaticall deleted unless ou ha!e e+plicitl sa!ed it.
Breakpoints at Subroutines
You can use this special kind of dnamic breakpoint to interrupt a program directl before a
subroutine is called.
Prere8uisites
You must alread be running the program in the Debugger.
Procedure
To set a breakpoint for a subroutine)
$. *hoose Brea"point Brea"point at E$ent#Subroutine.
2. .nter the name of the subroutine before which ou want to interrupt the program. B default, the
Program field contains the name of the program that is currentl acti!e. The sstem sets a
breakpoint where!er the specified subroutine occurs in the program code.
3. *hoose ENTER.
Resu$t
The sstem confirms the breakpoint. The breakpoint is added to the breakpoints displaed.
Breakpoints at Function Modu$e
You can use this kind of dnamic breakpoint to interrupt a program directl before a function
module is called.
Prere8uisites
You must alread be running the program in the Debugger.
Procedure

To set a breakpoint for a function module)
1% $hoose Breakpoint Breakpoint at Function module...
=. .nter the name of the function module before which ou want to interrupt the program. The
sstem sets a breakpoint where!er the specified e!ent, module pool, or subroutine occurs in the
program code.
!% *hoose ENTER.
ABAP Training Page & of 20
ABAP Debugger
Resu$t
If ou entered a !alid function module name, the sstem confirms that the breakpoint has been
set. If the function module e+ists in the sstem, the new breakpoint is added to the displa list.
Breakpoints at Sstem E%ceptions
You can use this special form of dnamic breakpoint to interrupt a program immediatel after a
runtime error has occurred.
Prere8uisites
You must alread be running the program in the Debugger.
Procedure
To set a breakpoint at a sstem e+ception)
*hoose Brea"point Brea"point at System exception.
Resu$t
The sstem confirms the breakpoint. The breakpoint is added to the breakpoints displaed.
When a sstem e+ception is triggered, a 9arning triang$e appears in the line containing the
statement that caused it. If ou double3click the warning triangle, the internal name of the runtime
error appears.
Saving Breakpoints
If ou want to lea!e the Debugger temporaril, ou can sa!e our dnamic breakpoints so that
the are still acti!e when ou return to the Debugger within the same terminal session.
To sa!e the breakpoints that ou ha!e set in the Debugger)
*hoose Brea"point Sa$e%
The sstem sa!es all of the breakpoints that ou ha!e set in the current program. These
breakpoints will remain acti!e until ou either e+plicitl delete them or log off from the sstem.
You can also delete breakpoints that ou ha!e sa!ed)
B deleting indi!idual breakpoints from the displa and then sa!ing again. In this case,
onl our selected breakpoints will be deleted.
By hoosing Breakpoint Delete all% 'n this ase, the system deletes all dynami
brea(points%
Managing Dnamic Breakpoints
The ABAP Debugger pro!ides a con!enient user interface for managing breakpoints. To open the
breakpoint displa, choose Brea"points, or, from the menu, Goto &ontrol ebugging
Brea"points.
Functions
This displa mode contains the following functions for breakpoints)
Breakpoint Disp$a
The scrollable breakpoint displa contains up to 4% dnamic breakpoints. 0or breakpoints that
ou set directl, the program name and line number at which the breakpoint occurs are displaed.
0or special breakpoint forms, the list displas the statements, e!ents, subroutines, and module
calls at which the rele!ant breakpoints are set.
"ounter
In the breakpoint displa, ou can specif a counter. When ou use a counter, the breakpoint is
not acti!ated until it has been reached a specified number of times. 0or e+ample, if ou enter >
for the counter, the breakpoint is not acti!ated until it is reached for the fifth time. After the
breakpoint has been acti!ated, it remains so, and the counter no longer appears in the breakpoint
displa.
De$eting Breakpoints
Position the cursor on the breakpoint that ou want to delete, and either double3click the line or
choose Brea"point Set#elete. To delete all breakpoints, choose Brea"point Delete all.
ABAP Training Page ) of 20
ABAP Debugger
Activating and Deactivating Breakpoints
Position the ursor on the brea(point that you *ant to ati+ate or deati+ate and hoose
Breakpoint Activate/deactivate%
ABAP Training Page , of 20
ABAP Debugger
-atchpoints
7ike a breakpoint, a watchpoint is an indicator in a program that tells the ABAP runtime processor
to interrupt the program at a particular point. ;nlike breakpoints, howe!er, watchpoints are not
acti!ated until the contents of a specified field change. Watchpoints, like dnamic breakpoints,
are user3specific, and so do not affect other users running the same program. You can onl
define watchpoints in the Debugger.
'se
You set watchpoints in the Debugger to monitor the contents of specific fields. The inform ou
when the !alue of a field changes. When the !alue changes, the Debugger interrupts the
program.
Features
You can set up to fi!e watchpoints in a program.
You can also specif the conditions on which a watchpoint is to become acti!e.
You can specif logical conditions between up to fi!e conditional watchpoints.
You can define watchpoints as either local or global. If ou define a global watchpoint, it is acti!e
in all called programs. 7ocal watchpoints are onl acti!e in the specified program.
You can change and delete watchpoints.
Setting -atchpoints
If ou want to interrupt a program when the contents of a field or structure change, use a
watchpoint. You can set up to fi!e watchpoints, including watchpoints for strings.
A watchpoint can be either $oca$ or g$oba$. 7ocal watchpoints are onl !alid in the specified
program. ?lobal watchpoints are !alid in the specified program, and also in all the other programs
it calls.
Procedure
To set a watchpoint, start the Debugger and proceed as follows)
$. $hoose Breakpoint Create watchpoint or the orresponding pushbutton% The
Create Watchpoint dialog bo- appears%
=. Decide whether ou want to set a local or global watchpoint.
4. .nter the program and the name of the field for which ou want to set the watchpoint. In
the Program field, the name of the program currentl running is alwas defaulted.
@. If ou want our watchpoint to be acti!ated each time the contents of the field change,
the definition is now complete, and ou can return to the Debugger b pressing ENTER .
>. To create a conditional watchpoint, that is onl acti!ated when a particular situation
arises, choose one of the following relational operators.
Operator Meaning
A 7ess than
AB 7ess than or e2ual
B .2ual
AC /ot e2ual
CB ?reater than or e2ual
C ?reater than
#.
D. You can use the &omparison fiel option to specif whether the comparison is to be
carried out with a !alue that ou specif or with the contents of another field. Depending on our
choice from step #, enter a !alue or a field for the comparison.

Resu$t
The sstem confirms the watchpoint and adds it to the list in the displa. When ou finish our
debugging session, the watchpoint is automaticall deleted unless ou ha!e e+plicitl sa!ed it.
ABAP Training Page . of 20
ABAP Debugger
Speci#ing ,ogica$ ,inks
If ou ha!e more than one conditional watchpoint, ou can specif a logical link between them)
," ,nl one of the specified conditions must be met
A/D All of the conditions must be met.

To create a logical link between watchpoints)
1% *hoose Goto &ontrol ebugging 'atchpoints or the 'atchpoints pushbutton to
open the watchpoint displa.
2% 'et the (ogical operator bet)een )atchpoints option.
The default !alue is alwas OR .
"hanging -atchpoints
1% $hoose Goto Control debugging Watchpoints or the Watchpoints
pushbutton to display the *athpoint list%
=. *hoose the pencil icon in the line containing the watchpoint ou want to change.
!% *hange the watchpoint attributes in the &reate#&hange 'atchpoint.
4. *hoose ENTER .

De$eting -atchpoints
You cannot delete watchpoints b choosing Brea"point Delete or Brea"point
Deacti$ate#acti$ate. Instead, proceed as follows)
$. *hoose Goto &ontrol ebugging 'atchpoints or the 'atchpoints pushbutton to
displa the watchpoint list.
=. *hoose the trashcan icon in the line containing the watchpoint ou want to delete.
Memor Monitoring 9ith -atchpoints
You can use watchpoints to displa changes to the references of strings, data and ob-ect
references, and internal tables. B placing an ampersand &:; in front of the ob-ect name, ou can
displa the reference in 2uestion in he+adecimal format. With internal tables, ou can also displa
the table header b placing an asterisk &E( at the beginning of the name.
:objectname Displas the references of strings, internal tables as well as data
and ob-ect references
<itab Displas the table header of the internal table itab
Ana$=ing Source "ode
The Debugger contains an e+tensi!e range of functions that help ou to analFe the source code
of a program. You can step through the source code of a program in four different was.
Disp$aing the Source "ode
All of the displa modes in the Debugger ha!e the same structure. The top half of the screen
displas an e+tract from the program source code as it appears in the ABAP .ditor.
Features
The Source coe of field contains an e+tract from the program, subroutine, or function module
currentl being processed. The source code displa also contains the following additional
functions)
E%pand!Reduce Program Segment
;se this button to close the information about the current displa mode. The sstem then
displas more of the source code.
ABAP Training Page 10 of 20
ABAP Debugger
;se this button to reopen the information for the current displa mode.
Entering ,ine Numbers
You can scroll in the source code using the arrow kes. If ou enter a line number in the left3hand
field, that line will become the top line of the displa.
Scro$$ing b Doub$e)"$icking
If ou double3click the first column of a line, it becomes the top line of the displa.
Scro$$ing one Screen at a *ime
You can use the Pg'p and PgDn kes to scroll up and down one page at a time in the source
code.
Navigating For9ards and Back9ards
If ou choose Debugging Goto Statement, the line containing the cursor is displaed. This
pro!ides ou with a straightforward wa of na!igating forwards and backwards in the displaed
source code.
Disp$aing the "urrent ,ine
This arrow indicates the ne+t line of source code that will be processed.
;se this button to make the current line appear in the source code displa.
Disp$a A#ter a Sstem E%ception
When a sstem e+ception is triggered, a warning triangle appears in the line containing the
statement that caused it. If ou double3click the warning triangle, the internal name of the runtime
error appears.
Finding a String in the Source "ode
To find a string in the source code, choose Eit Fin in source coe or the Fin icon from the
standard toolbar. A dialog bo+ appears in which ou can enter a string)
To find the ne+t occurrence of the same string, choose Eit Fin next in source coe, or the
appropriate icon.
Stepping *hrough the Source "ode
There are four different was in which ou can step through the source code of a program ou
want to analFe)
E%ecution *pes in Debugging Mode
Single step ;se this option to step through the program statement b statement. This
allows ou to branch to other programs.
Eecute ;se this option to process a program line b line. All of the statements on
the current line are processed in a single step. This allows ou to process
the whole program.
!eturn The Debugger returns to the point at which control returns to the main
program. ;se this option to return from other programs.
Continue ;se this option to process the program up to the ne+t breakpoint. If there
are no more breakpoints in the program, the sstem e+its debugging
mode and e+ecutes the rest of the program normall.
Processing Fie$ds

Disp$aing Fie$d (a$ues at Runtime
You can use the Fiels displa mode in the Debugger to displa the contents of program fields.
The displa can accommodate up to eight fields. This is the default displa mode in the
Debugger. The following data ob-ects are supported)
ABAP Training Page 11 of 20
ABAP Debugger
'ingle fields
'tructured fields
'trings
Internal tables
,b-ects
With more comple+ data ob-ects such as references or tables, the contents are not displaed
directl in the default displa mode. Instead, ou ha!e to double3click the field displa to call up
the appropriate attribute displa.

Procedure
$. 0rom an displa mode in the Debugger, choose Fiels.
=. .nter a field name directl in one of the fields in the displa, or select a field b double3
clicking its name in the source code displa. When ou select a field from the source code
displa, the sstem automaticall enters it in the field displa.
4. 'tep through the program using one of the e+ecution tpes.
Disp$aing Further Fie$ds
The field displa can contain up to eight fields, of which onl four can be displaed at a time.
You can displa the other fields b using the scroll buttons.
Disp$aing Sstem Fie$ds
This displa mode allows ou to displa the contents of an sstem fields. The three most
important sstem fields 'Y3';B"*, 'Y3TABIG, and 'Y3DB*/T are alwas displaed.
Disp$aing Fie$ds #rom E%terna$ Programs
You can also displa the contents of fields from e+ternal programs if ou know the names of
these. To do so, enter the program name in parentheses before the field name)
fielname*programname+.
Specia$ *pes o# Fie$d Disp$a
As in the program source code, ou can make offset and length entries for character3tpe
fields. If, for e+ample, ou enter sy-datum+4(2 ( in the field displa, the current month of the
sstem date is displaed under Fiel contents.
If ou specif an integer in angle brackets after the name of an internal table, the content
of the line that corresponds to the integer is output. The entr itab[4] , for e+ample, displas
the fourth line of the internal table itab . If the integer e+ceeds the number of current table lines,
the table will be flagged as unknown.
With data references, the content of the referenced data ob-ect is displaed if an arrow
and asterisk are appended to the name of the reference. r->* displas the content of the field
that is referenced b the data reference r .
If ou double3click a data or ob-ect reference under Fiel contents in the default displa
mode, all the attributes and field contents of the referenced data ob-ect are displaed in the ne+t
screen &data references(. The attributes and !alues of the current instance of all referenced
classes and interfaces are output under ob-ect references. 7<cl> , for e+ample, displas all the
!alues of the se!enth instance from class cl .
The headers of strings, internal tables as well as data and ob-ect references are
displaed if ou place an asterisk at the beginning of the name. 0or e+ample, the header of the
internal table itab is displaed in he+adecimal format if ou enter *itab in the field displa. The
field contains Feros if a table does not ha!e a header.
If ou place an ampersand at the beginning of the name, the reference of strings, internal
tables as well as data and ob-ect references are displaed in he+adecimal format. The entr &s tr,
for e+ample, displas the reference to the string str .
"hanging the Disp$a Format
You can displa the field contents either formatted for their data tpe or in he+adecimal format.
;se this button to displa the field contents in he+adecimal format.
ABAP Training Page 12 of 20
ABAP Debugger
;se this button to displa the field contents in their original output format.
De$eting A$$ Fie$d Names
;se this button to delete all field names from the field displa.
"hanging Fie$d (a$ues at Runtime
You can change the !alues of fields at runtime to see how the change would affect the program
flow. 'uppose ou ha!e found out that a field contains an incorrect !alue. You would be able to
replace it with another !alue in the Debugger to test whether the program would run properl in
that case.
You can change the !alues of the following data ob-ects of our program. If ou enter a !alue with
an incompatible tpe, the sstem displas an error message.
'ingle fields
'tructured fields
'trings
0ields of internal tables
0ields of classes and interfaces
Procedure
To replace the contents of a single field, proceed as follows)
$. *hoose Fiels to open the field displa mode.
=. Double3click or enter the name of a field in the source code to place it in the field displa.
The field name and its current !alue appear in the displa.
4. .nter a new !alue for the field.
@. *hoose the pencil icon &&hange fiel contents( at the end of the field displa.
With certain data ob-ects such as structures or internal tables, ou first ha!e to double3click the
appropriate field name to displa the attributes. You then ha!e to double3click the indi!idual fields
again to open the displa mode.
Resu$t
The Debugger writes the new !alue to the program field and the sstem records the change in
the sstem log. If ou do not click the pencil icon, the changed !alue is ignored.
The Debugger accepts the !alues e+actl as ou entered them. You must, therefore, ensure that
ou use the correct format &upper and lowercase, left3-ustified entr for he+adecimal numbers(.
Processing .nterna$ *ab$es

Disp$aing .nterna$ *ab$es
You can displa and change the contents of internal tables &including nested tables( at runtime in
the Debugger. The Debugger also pro!ides information about the table tpe, table ke, and the
amount of memor it re2uires.
Procedure
$. *hoose Table from an displa mode in the Debugger. The table displa appears.
=. .nter the name of an internal table in the Internal table field, or select a table b double3
clicking its name in the source code.
4. *hoose ENTER .
@. 'tep through the program using one of the e+ecution tpes.
+eader ,ine
If the internal table has a header line, it is indicated b this icon. If ou double3click the icon,
the sstem opens the Structure fiel displa. This contains the names of the components, their
current !alues, and the technical data of the table.
ABAP Training Page 1! of 20
ABAP Debugger
Scro$$ing (ertica$$
The table lines are numbered. The first column of the header is an input field in which ou can
enter the number of the line ou want to appear at the top of the displa. You can also scroll
using the scroll icons in the standard toolbar.
Scro$$ing +ori=onta$$
You can use the scroll buttons to scroll through the table horiFontall. If the table is too wide for all
of it to be displaed, use the scroll kes, or mo!e the column headers.
Moving "o$umn +eaders
You can change the order in which fields are displaed in the internal table displa. To do so,
o!erwrite the te+t in the field name list with the field names in the order in which ou want them to
appear. To remo!e a field from the displa, delete its field name from the header. If ou enter the
name incorrectl, the sstem displas a se2uence of 2uestion marks. If there is not enough room
to displa the entire field, the sstem shortens the field and displas the 1A1 character to inform
ou.
Shi#ting a "o$umn to the ,e#t
If ou double3click a column heading, the table displa shifts to the left. /one of the columns to
the left of the selected column heading are then !isible. 9owe!er, ou can restore them to the
displa b scrolling horiFontall.
Speci#ing a *ab$e *pe
/e+t to the table name, the Type field contains the table tpe. This ma be stanar, hashe, or
sorte.
"hanging the Disp$a Format
As with the field displa, ou can change the displa format in the internal table displa mode.
The Format field usuall contains the !alue E &for displa in columns with rele!ant formatting(.
9owe!er, it can also take the !alue > &he+adecimal displa(, or " &character displa(.
Resi=ing the *ab$e E%tract
*lick this button to increase the siFe of the table e+tract that is displaed. Three lines of ABAP
source code are displaed, and the rest of the screen is used to displa lines of the internal table.
*lick this button to reduce the table displa to fi!e lines. The rest of the screen is used to
displa the ABAP program code.
Disp$aing Memor 'se
To find out how much memor the internal table occupies, choose Goto Display conition
,emory usage.
"hanging .nterna$ *ab$es
You can change the contents of internal tables in the Debugger at runtime. You can delete, edit,
or add table lines.
De$eting ,ines
To delete a line from an internal table)
$. ,pen the internal table displa mode.
=. In the Internal table field, enter the name of the table.
4. *hoose ENTER . The sstem displas the contents of the table.
@. Position the cursor on the line that ou want to delete.
>. *hoose Delete. The line is remo!ed from the table, and the sstem automaticall corrects the line
numbering.
"hanging ,ines
The &hange, Insert, and Appen functions are field3specific, and can onl be used for a single
field at a time. 'uppose ou want to edit the following line)
LH001 FRANKFURT NEW YORK 145400 400 X
0irst, ou ha!e to decide which field ou want to edit. Then)
$. Position the cursor on the rele!ant field in the line that ou want to edit.
=. *hoose &hange. The field appears in input mode.
4. .nter a new !alue for the field.
ABAP Training Page 1" of 20
ABAP Debugger
@. *hoose ENTER . The sstem updates the line and displas the changed contents in the table.
.nserting ,ines
The Insert and Appen functions allow ou to add a new line to an internal table. If ou choose
Appen, the new line is added to the end of the table. If ou choose Insert, ou can add the new
line at an position in the table. To insert a new line at the end of the table)
$. *hoose Appen.
=. .nter a !alue for the first field of the line.
4. *hoose ENTER . The sstem adds a new line to the end of the table, containing the !alue
that ou entered for the first field.
@. .nter !alues in the remaining fields as described abo!e.
If ou want to add a line in the middle of the internal table, place the cursor on the line after which
ou want to insert it. *hoose Insert, then follow the procedure described abo!e from step =.
Attributes o# Data Objects
In the Debugger, ou can displa the attributes and contents of data ob-ects in a separate area of
the screen. This technical information is a!ailable for the following data ob-ects)
'ingle fields
'tructured fields
'trings
Internal tables
Data references
Objets
Procedure
To open the displa)
$. *hoose Goto Display ata ob!ect ? Single fiel H Structure fiel H String H Internal table H
-b!ect @.
=. .nter the name of the data ob-ect and choose Enter , or double3click the data ob-ect in the
source code.
4. The following information is then displaed depending on the data ob-ect ou selected)
'ingle field /ame, field contents, tpe, length, output length, decimal places
'truc. field /ame, length, number, component name, tpe, length, contents
'tring /ame, tpe, current length, content
Internal table /ame, tpe, format, line number, line contents
,b-ect /ame, class:interface, number, attributes:interfaces, tpe, length, contents

If ou want to displa more information in the attribute o!er!iew on particular fields of a structure,
table or class, open the detail displa b double3clicking the appropriate field. *hoose Bac" to
return to the o!er!iew.
If ou enter the name of a single field in the attribute displa for a structured field, the sstem
switches automaticall to the single field displa. 7ikewise, if ou enter the name of a structured
field in the attribute displa for a single field, the sstem will switch to the structured field displa.
Disp$aing Data Re#erences
If ou double3click a data reference dre# in the Fiel names column, information on the technical
attributes of this are displaed. If ou double3click the Fiel contents column, the contents of the
data reference are displaed. The referenced ob-ect is displaed when ou double3click the data
reference dr!-"# in the Fiel names column.
Disp$aing the 'nicode Fragment (ie9
ABAP Training Page 1# of 20
ABAP Debugger
The ;nicode fragment !iew is displaed when ou choose Goto Display ata ob!ect System
Information. In this !iew, structures, internal tables, strings, data references, and ob-ects are split
into alignment gaps, bte and character3tpe areas, and all other tpes such as P, I, 0, strings,
references and internal tables.
Ad-acent character3tpe components of a structure &with the e+ception of strings( are combined
internall to form e+actl one group if there are no alignment gaps between these components.
All possible alignment re2uirements for characters are taken into account here. Ad-acent bte3
tpe components are also combined in the same wa.
Other Functions
The Single fiel displa mode, like the Fiels mode, can be used to change the contents of a field
or displa them in he+adecimal format.
In the Structure fiel displa mode, ou can show and hide substructures.
0or further special tpes of displa, refer to Processing 0ields.
Disp$aing Objects in ABAP Objects
The Debugger displas the attributes of classes, instances, and interfaces in a similar wa to
structured fields.
Procedure
To displa an ob-ect in ABAP ,b-ects)
$. *hoose Fiels. This opens the default displa mode.
=. In the ABAP program code displa, double3click the name of an ob-ect to place it in the
field displa. The Fiel contents field contains the ob-ect ID &class name and identification
number(.
4. Double3click the ob-ect ID. The Debugger opens the -b!ect displa mode.
You can also open the ob-ect displa b choosing Goto Display ata ob!ect -b!ect.
9owe!er, in this case, ou must specif the ob-ect ID e+plicitl.
@. Ad-ust the displa to our re2uirements b setting the &lass attributes and instance
attributes options and selecting a !isibilit section &public, protected, or pri!ate(.
>. *hoose Filter to filter the attributes for the displa. The ob-ect attributes are listed with
their names, technical properties &data tpe and length(, and their content. The displa also
contains the interfaces. You can displa its attributes b choosing Expan.
If an attribute is a reference to another ob-ect, ou can displa the attributes of the referenced
ob-ect b double3clicking the field contents of the ob-ect in the displa.
If ou enter the name of a class &AnameC( in the -b!ect *I+ field, the sstem displas the static
attributes of the class, regardless of whether it has been instantiated.
Other Functions
Navigation
If ou double3click the name of an attribute, the sstem opens the single field displa.
If ou double3click the name of an interface, the sstem displas onl the attributes that belong to
that interface.
Re#erences
If ou position the cursor on a field in the field displa that contains an object re#erence, ou can
find all !ariables or attributes &both local and global( that point to the ob-ect b choosing Goto
System Fin references. The same applies to data re#erences.
Disp$aing Events
The e!ent displa pro!ides an o!er!iew of all of the e!ents belonging to an ob-ect and the
handlers that are registered for them.
To open the e!ent displa, choose E$ents. The sstem lists all of the e!ents belonging to the
ob-ect specified under -b!ect *I+. The displa lists the ob-ect IDs of all hanler ob!ects registered
for the e!ent and the hanler methos that will be called when the e!ent is triggered.
;se the -b!ect pushbutton to return to the ABAP ,b-ects displa.
ABAP Training Page 1& of 20
ABAP Debugger
If ou enter a class in the -b!ect *I+ field &AnameC( and then choose E$ents, the sstem displas
the handler methods and ob-ects for all e!ents of the class. The class does not ha!e to ha!e
been instantiated.
ABAP Training Page 1) of 20
ABAP Debugger
Other Functions
Disp$aing ,ists
If ou are testing a program that generates a list, ou can displa the list in the Debugger.
As soon as the list has been created, the sstem displas this icon. *lick it to open the list
displa. The displa contains all lines of the list that ha!e been generated so far with the
appropriate formatting.
The current list line is not formatted until it is complete &/.W37I/.(.
"a$$ ,inks
0rom the Debugger, ou can open the ABAP .ditor, the ,b-ect /a!igator, and the 'creen
Painter. If ou find an error in a program while ou are testing it, this function allows ou to switch
directl to the ABAP .ditor or ,b-ect /a!igator to correct it straight awa in the source code.
To open the ABAP /ditor, hoose Development ABA !ditor% The system opens a
ne* session and displays the program you *ere debugging%
To open the ,b-ect /a!igator from the ABAP Workbench, choose De$elopment
-b!ect .a$igator. The sstem opens a new session and starts the ,b-ect /a!igator.
To displa the flow logic of a screen, choose De$elopment Screen Painter. This
function is onl acti!e in programs for which ou ha!e defined screen flow logic.
Debugging in Production "$ients
'ince the contents of the database in a production c$ient must alwas be consistent, there are
particularl strict re2uirements for debugging in them)
Production clients do not ha!e the !alue 1T1 in the ***AT.?,"I. field of table T%%%.
This is wh the sstem must not e+ecute a $OMMIT WORK . What is particularl important
is that all database changes can be rolled back in the e!ent of a program termination. To ensure
that this is possible, a dialog process con!erts to a debugging process. This process is assigned
to the user for the duration of their debugging session. This is wh no $OMMIT WORK is e+ecuted
b the sstem.
To ensure that debugging ati+ities annot blo( the *hole system, only half of
all dialog proesses an be used for debugging%
'ince onl a restricted number of dialog work processes can switch to debugging mode, ou
should e+it the Debugger as soon as ou no longer need it. ,therwise, ou will unnecessaril
block the work process.
In test c$ients, where data integrit is not so crucial, the number of dialog processes that are
a!ailable for debugging is defined !ia the profile parameter risp#)pbug/max/no. If another
users want to debug the database, and the process cannot, therefore, con!ert to a debugging
process, a $OMMIT WORK must be e+ecuted after each step, and the process is released again
for all other users. The database changes cannot, therefore, be rolled back if a program
termination occurs.
Re$easing Database ,ocks
During Debugging, the *,55IT statement, which indicates the end of a 7ogical ;nit of Work
&,'-(, ma occur after a significant number of debugging steps. An database locks that are set
are maintained for the whole of this time.
There ma be occasions when ou want to interrupt our testing without actuall ending the
debugging session. In this case, ou should release the database locks, otherwise other users
will not be able to make changes until our debugging session is finished.
To do this, choose Debugging Database &ommit *unloc"+ to unlock the database and
permanentl write the changes to the database. "emember that this could, in certain
circumstances, lead to database inconsistencies.
If ou want to undo all of the database changes that ha!e been made since the last commit,
choose Debugging Database 0ollbac".
ABAP Training Page 1, of 20
ABAP Debugger
You can check the last statements transferred to the database b choosing Goto System
System areas after ou ha!e started the Debugger, and entering -S1( in the Area field.
Settings and -arnings
0rom the Debugger, ou can set the debugging mode and the sstem beha!ior in the e!ent of a
kernel warning b choosing Settings.
Sstem Debugging
If ou set this option, the Debugger is also acti!ated for sstem programs &programs with status S
in their program attributes(. When ou sa!e breakpoints, the System ebugging setting is also
sa!ed.
'pdate Debugging
;pdate function modules are not processed in the same task as the program that is currentl
running in the Debugger. Instead, the run in an update work process. These function modules
are therefore not included in debugging. ,nl if ou select the Upate ebugging option can ou
displa and debug them after the *,55IT W,"8.

.n Background *askA Do not Process
When ou debug a program that calls function modules using the I/ BA*8?",;/D TA'8
addition, the are processed in a background work process &additional internal session(. If ou set
the In bac"groun tas"2 Do not process option, the sstem collects the function calls, but does not
start the background work process. The Debugger assigns a transaction ID, which identifies the
background work process uni2uel. You can now start the Debugger for the background work
process using transaction SMBC. You can select the function module concerned here, and then
e+ecute it !ia the Eit menu.
Automation "ontro$$er
This Debugger option controls the wa in which re2uests to automation ob-ects &Automation
'er!er and ?;I controls( are processed.
$. If the option is not set, the re2uests are processed as the would normall be in the ABAP
program. "e2uests with the /, 07;'9 addition are not processed until
An e+plicit flush occurs
A re2uest is processed that does not ha!e the /, 07;'9 addition.
=. If ou select this option, all re2uests are processed snchronousl, regardless of an /,
07;'9 additions.
This helps ou to find errors. If an error occurs when the automation 8ueue is being processed,
the snchronous re2uest processing option allows ou to identif the re2uest in which the error
occurred.
.nabling this option dramaticall affects the runtime of the program, since the ABAP program
cannot continue processing until the re2uest has been e+ecuted b the recei!er. You must bear
in mind that the recei!er I the automation ser!er or control on the presentation ser!er I ma be
linked using a slow WA/ connection.
"reating E%ception Objects
The following functions are supported for class3based e+ceptions)
1% If the .N*O re# addition is missing in the $AT$H statement, ou can create an e+ception
ob-ect in the Debugger b choosing Settings.
2% When ou choose Display the Exception -b!ect, the attributes and interfaces of the
e+ception class are displaed together with their contents.
When ou choose Statement that &ause the Exception, the line of the source code containing the
statement that caused the e+ception is displaed. The statement is marked e+plicitl in the source
code.
Memor Monitoring
After each ABAP statement, the sstem e+amines the roll area of the current session. This allows
ou to check whether neighboring memor areas ha!e been o!erwritten.
ABAP Training Page 1. of 20
ABAP Debugger
You can also displa the memor usage for ob-ects, tables, references and single fields b
choosing Settings ,emory Display -n#-ff. A distinction is made here between allocated and
referenced memor. The memor actuall used for each data ob-ect is also indicated.
You can displa a hit list of the => data ob-ects with the highest memor consumption b
choosing Goto System System areas. You can enter the following !alues in the Area field)

Area
+it $ist
ITAB3T,P=> Displas ma+. => internal tables
,BJ3T,P=> Displas ma+. => ob-ects
".03T,P=> Displas ma+. => references
A773T,P=> Displas the => data ob-ects with the highest memor consumption

Runtime -arnings
The profile parameter abap!9arnings controls the beha!ior of the ":4 'stem when a kernel
warning occurs. You can displa and change it using Transaction RD33. The Debugger also
allows ou to o!erride the default setting of this parameter during our debugging session b
choosing one of the following three options)
(og )arnings) An warnings that occur are recorded and listed in the Debugger under
Settings.
Stop at )arning) The sstem stops processing in the line of the program in which the
warning occurred.
Dump at )arning) The sstem triggers a short dump when a warning occurs.
0ou an display the last runtime error that ourred by hoosing Development Displa"
last short dump% 0ou an also use the transation last_shortdump%
ABAP Training Page 20 of 20

You might also like