Debugging
Debugging
06/27/2011
Agenda
- Definition
- Debugging Strategies
- Use of Break Points
- Deleting Break Points
- Q&A
2
Definition
3
Debugging Strategies
•There are two debugging strategies from
within the ABAP/4 Development Workbench.
The user can set breakpoints in a program
and then execute the program within the
debugging tool or the user can run a program
in the debugger without breakpoints.
•Setting breakpoints is a good strategy for
examining the program:
– After the system has processed certain events
– Immediately before a specific event is carried out
– By skipping to specific routines or calls
•Execution of a program in the debugger
without breakpoints allows for:
– Examination of a program from the first line of code
4
Using Breakpoints
• A breakpoint is a signal within a program’s code that tells
the ABAP/4 processor to interrupt the program where the
breakpoint is set.
• Four different types of breakpoints can be set in ABAP/4:
– Static Breakpoints: Breakpoints that are written directly into the
program’s code.
– Dynamic Breakpoints: Breakpoints that are set from within the ABAP/4
editor or the debugger. Dynamic breakpoints are invisible in the
ABAP/4 editor.
– Watchpoints: Watchpoints are set within the debugger and are field
specific. A watchpoint becomes a breakpoint when the contents of a field
change.
– Breakpoints at key words/statements: Breakpoints set in the
debugger that are key word or event specific. The breakpoint becomes
active when the ABAP/4 runtime processor comes across the specified
keyword or event in the program’s code.
5
Using Breakpoints Cont..
6
Using Breakpoints Cont..
Setting Dynamic Breakpoints
Dynamic breakpoints are user-specific. Use Dynamic Breakpoints to
interrupt a program when it is executed by the user, but not when
others are running it.
– In the ABAP/4 Editor the user can set breakpoints in change or display mode by:
– Place the cursor on the line where the breakpoint is to be
positioned.
– Choose < Utilities Breakpoints Set >
– In the debugger dynamic breakpoints can be set by:
– Place the cursor on the line where the breakpoint is to be positioned.
– Select the line either by choosing the < Breakpoints Set/delete
> function or by double-clicking.
– Program breakpoints are indicated by a small stop sign in front of the affected line.
– The system allows a maximum of 32 breakpoints.
7
Using Breakpoints Cont..
8
Using Breakpoints Cont..
Setting Watchpoints
– Watchpoints are set from the debugging tool.
– Watchpoints are used to interrupt a program when there is a change in
the contents of a particular field or field string.
– To set a watchpoint:
– Find the field needed in the program field display.
– Place the cursor directly on the field.
– Press the button marked for Fields Display. The field
display shows the field’s current contents and offers detailed
technical information.
– To set the field as a watchpoint, select the Watchpoint
checkbox to the right of the field’s name. Continue processing by
pressing the Continue button on the tool bar.
– If no changes occur in the program after a watchpoint has been set, the
program will execute without interruption.
– Only one watchpoint can be set at a time. To display the current
watchpoint field, look at the bottom of the breakpoint overview screen.
This list can be viewed using the menu path < Goto -->Control
debugging --> Watchpoints >.
9
Deleting and Deactivating Breakpoints
– To delete all the dynamic breakpoints in a program use the menu path <
Breakpoint® Delete all>.
– Double clicking on the stop sign to the left of the code will also
deactivate
a breakpoint.
– To execute a report without interruption, use the menu path <
Breakpoint ® Deactivate all > when processing in the debugger.
– For an overview of all existing breakpoints, use the menu path < Goto --
> Control Debugging --> Breakpoints >. With this function the user can
specify the number of passes that should occur before a breakpoint is
activated
10
Basic Debug Functions
The following functions are used in Debugging
/H – This function key is used trigger the debugging
F5 – Single Step Execution
F6 – complete the step process
F7 – Return to the main step
F8 – Execute button to complete the process and comes of
out of the debugger. If there are further break-points set up
then this will go the next break point.
11
Q&A
Thank
You!!!
12