0106 debugging
Post on 18-Oct-2014
3.241 views
DESCRIPTION
TRANSCRIPT
Debugging
Copyright © 2005 Accenture2
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
Copyright © 2005 Accenture3
What is Debugging?
• Tool used to identify and eliminate errors in ABAP programs
• Allows the verification of program logic in a step-by-step manner by examining the results of individual statements
Copyright © 2005 Accenture4
Branching to Debugging Mode
Program ... . Breakpoint ... .
ABAP Editor
ABAP Debugger
ABAP Debugger
Debugging
Program B170D051
Breakpoints
Object List
Development object ... ... ...
. . .Test/execute. . .
Any screen
... ... ... System Help
. . .Utilities. . .
. . .Debug ABAP. . ./h
Copyright © 2005 Accenture5
Key Debugging Concepts
• Debugger modes
• Examining the value of variables
• Changing the value of variables
• Setting breakpoints
• Setting watchpoints
• Viewing contents of internal tables
Copyright © 2005 Accenture6
The Debugging Display
ABAP Debugger
WatchpointfZC C
Table Breakpoints Watchpoints Calls Overview SettingsFields
Main Program
Source code of
EVENT START-OF-SELECTION
where matkl = c_matkl.
Loop at i_tab.
v_counter = v_counter + 1.
at new vbeln.
write:/ i_tab-vbeln color COL_HEADING.
ENDAT.
write: /10 i_tab-posnr,
i_tab-arktx.
endloop.
ZZXXXXX
ZZXXXXX
I_TAB-VBELN 0001234 + /
Copyright © 2005 Accenture7
Debugging Mode
Copyright © 2005 Accenture8
Examining the Value of Variables
Copyright © 2005 Accenture9
Changing the Value of Variables
Copyright © 2005 Accenture10
The Most Important Debugging Functions
Single Step
Execute
Continue
Table
Breakpoint
Watchpoint
Return
Hexadecimal display
Replace
Processes the next program line
Allows the change of data contents during debugging
Processing continues until the next breakpoint (or end of program) is encountered
Displays the contents of internal tables
Displays data in hexadecimal format
Interrupts the program when there is a change in a field
Identifies breakpoints
Executes all processing steps belonging to one statement
Returns from a routine
Copyright © 2005 Accenture11
Setting Breakpoints
Menu:
Keyword:
Utilities -> Breakpoints
BREAK-POINT
Line selection (double-click)Breakpoint pushbutton
Menu:
ABAP Editor
Debugging Mode
Breakpoint -> Create/DeleteActivate/Deactivate Delete AllDeactivate AllSaveBreakpoint AtCreate Watchpoints
Copyright © 2005 Accenture12
Watchpoints
Debugging .. Breakpoint ..
ABAP Debugger
WatchpointfZC C
or
Create/Delete
..
..
..
Create Watchpoint
Copyright © 2005 Accenture13
Viewing Contents of Internal Tables
Copyright © 2005 Accenture14
Exercise
Exercise 7 – Use the ABAP Debugger, 20 minutes
Copyright © 2005 Accenture15
Any questions?
Question and Answers