0% found this document useful (0 votes)
8 views

Debugging

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Debugging

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

Debugging

06/27/2011
Agenda

- Definition
- Debugging Strategies
- Use of Break Points
- Deleting Break Points
- Q&A

2
Definition

Debugging: Debugging is a valuable


tool for diagnosing problems with program
code. This tool allows the user to watch the
program execute and determine where the
problem with a statement, variable or table
occurs.

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..

Setting Static Breakpoints


– Static breakpoints are generally user-independent.
Once they are set, they are activated whenever the program
is executed.
– To set a static breakpoint, enter the ABAP/4 Editor and write
the key word BREAK-POINT directly in the program code.
– Place the breakpoint on the line where you want the program
to be interrupted.
– When the report is executed, ABAP/4 interrupts the
processing at the breakpoint.
– Static breakpoints are user specific. Use the key word
BREAK followed by the user name (i.e., BREAK JWARREN).
– The breakpoint is visible to other users if they display the
program’s code in the Editor.

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..

Setting Breakpoints at Keywords or Events


– Tell the system to stop the processing whenever a return
code in the
SY-SUBRC field is not equal to 0.
– To set event or keyword-related breakpoints, do the following:
– From the debugger, select either
– < Breakpoint -->Breakpoint at --> At <necessary choice>
>
– Within the screen displayed type the subroutine
name, event or key word. The system will set the
breakpoint.
– Select the ‘O. K.’ button. Breakpoints are indicated
by a small stop sign.

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

Static Break points - To deactivate a static breakpoint, remove it


from the program in the ABAP/4 Editor. Static breakpoints cannot be
removed or deactivated once the debugger has started.

Dynamic Break Points –

– 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

You might also like