2007 Aug 31 1:23 PM
hi all
1)what are break ponts & how many types are there ?
2)what are watch points ?
how to decide where to use break points & watchpoints ?
which one is better ?
thanks
2007 Aug 31 1:30 PM
1.Break points are used to terminate the process at a desired place of the program.
2.we can achive break point eithe by pressing /h during the exection or set break point in the progrm line by double clicking it or type break point1,2....
3.watch point is used to see changes for eg to say u wanna watch the variable change throught the program it would be useful
its up to u to use depending on need.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
2007 Aug 31 1:30 PM
1.Break points are used to terminate the process at a desired place of the program.
2.we can achive break point eithe by pressing /h during the exection or set break point in the progrm line by double clicking it or type break point1,2....
3.watch point is used to see changes for eg to say u wanna watch the variable change throught the program it would be useful
its up to u to use depending on need.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
2007 Aug 31 1:33 PM
Hi Fighter,
Break points are used to debug your code in a specific line where you actually prefer.
watch point are also used to debug where you will mention the variables
both are for debugging purpose ,if you have large program where you are unable to find the exact line then you can set debug option in Watch point.
Reward useful answers..
Siva
2007 Aug 31 1:36 PM
Hi,
depending on the situation we have to go for break point
and watch points
watch points can be put when we go inside the debugger
but we can put a break point even when we are in the abap editor
so there so many ways to put break point
press cltrl+ shift + f12
then it will put on that particular line when you are in the abap editor
this is same as cliking the break point button
which is there in the application tool bar
and you can press debugging in the se38 editor
and you can write break-point
every time it will stop there for all users...
or break user name in the editor
every time it will stop there for that user
even in the runtime you can give the break points
double clik on the left most side
it will create a break point...
<b>watch points</b>
when you are in debugging mode
clik the watch point button
and you hve to give the variable name
and
value and also in the middle you have to give
comparison value
like = or > or < or >= or <= like that
then it will stop when the value of that variable reaches
so the main difference is
<b>break point is on a particular line of the code</b>
and the watch point
<b>is like a break point on reaching the value of a particular variable or
internal table field value</b>
thanks & regards,
Venkatesh
2007 Aug 31 1:47 PM
hI
<b>Breakpoints</b> A scrollable display containing up to 30 breakpoints. Next to each breakpoint is a counter. You can also delete breakpoints in this display. See also Managing Dynamic Breakpoints
<b>Watchpoints</b> You can set a watchpoint for a field so that the program is interrupted whenever the value of that field changes. This display mode contains a list of watchpoints, the fields and programs to which they are assigned, the current values of the fields, and the conditions upon which the watchpoint is activated. See also Setting Watchpoints
<b>Breakpoints</b>
Instead of starting an ABAP program directly in the Debugger, you can also debug a program by 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 normally until the breakpoint is reached.
There is also a special kind of breakpoint called a watchpoint. When you use watchpoints, the Debugger is not activated until the contents of a particular field change. For further information, refer to Watchpoints.
Breakpoint Variants
The Debugger contains different breakpoint variants:
Static The BREAK-POINT statement in an ABAP program. Static breakpoints are not normally user-specific. However, you can make them user-specific.
Directly-set
dynamic breakpoints Can be set in the ABAP Editor or the Debugger. Dynamic breakpoints are always user-specific, and are deleted when you log off from the R/3 System.
Breakpoint
at statement The Debugger stops the program directly before the specified statement is executed.
Breakpoint
at subroutine The Debugger stops the program directly before the specified subroutine is called.
Breakpoint at function module The Debugger stops the program directly before the specified function module is called.
Breakpoint at method The Debugger stops the program directly before the specified method is called.
Breakpoints at system exceptions The Debugger stops the program directly after a system exception, that is, after a runtime error has been intercepted.
Use
Static Breakpoints
Static breakpoints are not normally user-specific. Once a user has inserted a BREAK-POINT statement in an ABAP program, the system always interrupts the program at that point. You should only use static breakpoints during the development phase of an application. You should set static breakpoints whenever more than one programmer is working on the same program and you always want to stop the program in the same place.
Dynamic Breakpoints
Dynamic breakpoints are user-specific. You should, therefore, use them when you only want the program to be interrupted when you run it yourself. 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. They have the following advantages:
You do not have to change the program code
You can set them even when the program is locked by another programmer
You can define a counter (for example, only activate the breakpoint after it has been reached five times).
Special Dynamic Breakpoints
Special dynamic breakpoints are useful when you want to interrupt a program directly before a particular ABAP statement, a subroutine, or an event, but do not know exactly where to find it in the program code. Event here is used to refer to the occurrence of a particular statement, for example, or calling up a method. Special dynamic breakpoints are user-specific. You can only set them in the Debugger.
Transferring Breakpoints to HTTP and Update Sessions
If an HTTP or update session is called from a Logical Unit of Work (LUW), new work processes are started for these new sessions. Breakpoints that were defined beforehand in the calling LUW are copied to these sessions where they can be displayed under breakpoints.
If, for example, the update module func is called via CALL FUNCTION func IN UPDATE TASK, the new work process is displayed in a second window if Update debugging was selected under Settings in the debugging mode. All the breakpoints that were set in the calling LUW can then be processed here.
Static Breakpoints
You should only use static breakpoints during the development phase of an application. You must remove them from your program before you transport it.
Setting Breakpoints
To set a static breakpoint, use the ABAP statement BREAK-POINT . Place the breakpoint in the line at which you want to interrupt the program.
program RSDEBUG_01.
....
if SY-SUBRC <> 0.
break-point.
endif.
....
When you run the program, the runtime processor interrupts it when the breakpoints occur. You can number your breakpoints to make them easier to identify ( BREAK-POINT 1, BREAK-POINT 2 ).
Static breakpoints are not normally user-specific. The program is, therefore, always interrupted as soon as the runtime processor reaches the line containing the breakpoint. The program is interrupted regardless of the user who executes it.
However, you can set user-specific static breakpoints using the BREAK statement followed by your user name. For example, if you use the statement BREAK SMITH , the program is only interrupted when user Smith runs it. Although user-specific breakpoints appear in the program code, they are not active when other users run the program. You should, however, be careful if an application is being used by several users with the same name.
Deleting Breakpoints
Since static breakpoints apply to all users, you must remove them from the program once you have finished testing it. In the ABAP Editor, you can find breakpoints quickly by choosing Utilities  Global search. You can also use the Extended Program Check to find them.
If you do not remove static breakpoints from your program, they will be transported to your production system. This could cause serious problems in the production system.
Dynamic Breakpoints
You can set up to 30 dynamic breakpoints without changing the program code. Dynamic breakpoints can be set either in the ABAP Editor or directly in the Debugger.
Setting Dynamic Breakpoints in the ABAP Editor
You can set dynamic breakpoints in the ABAP Editor regardless of whether you are in display or change mode. You can also set breakpoints directly from within the Debugger at runtime. To set a dynamic breakpoint in the ABAP Editor:
1. Position the cursor on the line of the source code at which you want to set the breakpoint.
2. Choose Utilities  Breakpoints  Set or the Stop icon. The system confirms that the breakpoint has been set.
To display a list of all dynamic breakpoints in a program, choose Utilities  Breakpoints  Display. You can use this list to navigate to a particular breakpoint or to delete one or more breakpoints from the program.
Setting Dynamic Breakpoints in Debugging Mode
To set a dynamic breakpoint in the Debugger:
1. Position the cursor on the line in which you want to set the breakpoint.
2. Select the line by double-clicking it or choosing Breakpoint  Set/delete.
The system sets the breakpoint, and displays a small stop sign to the left of the relevant line. If the line already contained a breakpoint, it is deleted.
When you finish your debugging session, the breakpoint is automatically deleted unless you have explicitly saved it.
Breakpoints at Statements
You can use this special kind of dynamic breakpoint to interrupt a program directly before an ABAP statement is processed.
Prerequisites
You must already be running the program in the Debugger.
Procedure
To set a breakpoint at an ABAP statement:
1. Choose Breakpoint  Breakpoint at  Statement...
2. Enter the ABAP statement.
The system sets a breakpoint at all points in the program at which the ABAP statement occurs.
3. Choose ENTER.
The breakpoint applies to all lines containing the specified statement.
Result
The system confirms the breakpoint and adds it to the list in the display. When you finish your debugging session, the breakpoint is automatically deleted unless you have explicitly saved it.
Breakpoints at Subroutines
You can use this special kind of dynamic breakpoint to interrupt a program directly before a subroutine is called.
Prerequisites
You must already be running the program in the Debugger.
Procedure
To set a breakpoint for a subroutine:
1. Choose Breakpoint  Breakpoint at  Event/Subroutine.
2. Enter the name of the subroutine before which you want to interrupt the program. By default, the Program field contains the name of the program that is currently active. The system sets a breakpoint wherever the specified subroutine occurs in the program code.
3. Choose ENTER.
Result
The system confirms the breakpoint. The breakpoint is added to the breakpoints displayed.
Breakpoints at Function Module
You can use this kind of dynamic breakpoint to interrupt a program directly before a function module is called.
Prerequisites
You must already be running the program in the Debugger.
Procedure
To set a breakpoint for a function module:
1. Choose Breakpoint  Breakpoint at  Function module...
2. Enter the name of the function module before which you want to interrupt the program. The system sets a breakpoint wherever the specified event, module pool, or subroutine occurs in the program code.
3. Choose ENTER.
Result
If you entered a valid function module name, the system confirms that the breakpoint has been set. If the function module exists in the system, the new breakpoint is added to the display list.
Breakpoints at System Exceptions
You can use this special form of dynamic breakpoint to interrupt a program immediately after a runtime error has occurred.
Prerequisites
You must already be running the program in the Debugger.
Procedure
To set a breakpoint at a system exception:
Choose Breakpoint  Breakpoint at  System exception.
Result
The system confirms the breakpoint. The breakpoint is added to the breakpoints displayed.
When a system exception is triggered, a warning triangle appears in the line containing the statement that caused it. If you double-click the warning triangle, the internal name of the runtime error appears.
Saving Breakpoints
If you want to leave the Debugger temporarily, you can save your dynamic breakpoints so that they are still active when you return to the Debugger within the same terminal session.
To save the breakpoints that you have set in the Debugger:
Choose Breakpoint  Save.
The system saves all of the breakpoints that you have set in the current program. These breakpoints will remain active until you either explicitly delete them or log off from the system.
You can also delete breakpoints that you have saved:
By deleting individual breakpoints from the display and then saving again. In this case, only your selected breakpoints will be deleted.
By choosing Breakpoint  Delete all. In this case, the system deletes all dynamic breakpoints.
Managing Dynamic Breakpoints
The ABAP Debugger provides a convenient user interface for managing breakpoints. To open the breakpoint display, choose Breakpoints, or, from the menu, Goto  Control debugging  Breakpoints.
Functions
This display mode contains the following functions for breakpoints:
Breakpoint Display
The scrollable breakpoint display contains up to 30 dynamic breakpoints. For breakpoints that you set directly, the program name and line number at which the breakpoint occurs are displayed. For special breakpoint forms, the list displays the statements, events, subroutines, and module calls at which the relevant breakpoints are set.
Counter
In the breakpoint display, you can specify a counter. When you use a counter, the breakpoint is not activated until it has been reached a specified number of times. For example, if you enter 5 for the counter, the breakpoint is not activated until it is reached for the fifth time. After the breakpoint has been activated, it remains so, and the counter no longer appears in the breakpoint display.
Deleting Breakpoints
Position the cursor on the breakpoint that you want to delete, and either double-click the line or choose Breakpoint  Set/delete. To delete all breakpoints, choose Breakpoint  Delete all.
Activating and Deactivating Breakpoints
Position the cursor on the breakpoint that you want to activate or deactivate and choose Breakpoint  Activate/deactivate.
<b>Watchpoints</b>
Like a breakpoint, a watchpoint is an indicator in a program that tells the ABAP runtime processor to interrupt the program at a particular point. Unlike breakpoints, however, watchpoints are not activated until the contents of a specified field change. Watchpoints, like dynamic breakpoints, are user-specific, and so do not affect other users running the same program. You can only define watchpoints in the Debugger.
Use
You set watchpoints in the Debugger to monitor the contents of specific fields. They inform you when the value of a field changes. When the value changes, the Debugger interrupts the program.
Features
You can set up to five watchpoints in a program.
You can also specify the conditions on which a watchpoint is to become active.
You can specify logical conditions between up to five conditional watchpoints.
You can define watchpoints as either local or global. If you define a global watchpoint, it is active in all called programs. Local watchpoints are only active in the specified program.
You can change and delete watchpoints.
Setting Watchpoints
If you want to interrupt a program when the contents of a field or structure change, use a watchpoint. You can set up to five watchpoints, including watchpoints for strings.
A watchpoint can be either local or global. Local watchpoints are only valid in the specified program. Global watchpoints are valid 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:
1. Choose Breakpoint  Create watchpoint or the corresponding pushbutton. The Create Watchpoint dialog box appears.
2. Decide whether you want to set a local or global watchpoint.
3. Enter the program and the name of the field for which you want to set the watchpoint. In the Program field, the name of the program currently running is always defaulted.
4. If you want your watchpoint to be activated each time the contents of the field change, the definition is now complete, and you can return to the Debugger by pressing ENTER .
5. To create a conditional watchpoint, that is only activated when a particular situation arises, choose one of the following relational operators.
Operator Meaning
< Less than
<= Less than or equal
= Equal
<> Not equal
>= Greater than or equal
> Greater than
6.
7. You can use the Comparison field option to specify whether the comparison is to be carried out with a value that you specify or with the contents of another field. Depending on your choice from step 6, enter a value or a field for the comparison.
Result
The system confirms the watchpoint and adds it to the list in the display. When you finish your debugging session, the watchpoint is automatically deleted unless you have explicitly saved it.
Specifying Logical Links
If you have more than one conditional watchpoint, you can specify a logical link between them:
OR Only one of the specified conditions must be met
AND All of the conditions must be met.
To create a logical link between watchpoints:
1. Choose Goto  Control debugging  Watchpoints or the Watchpoints pushbutton to open the watchpoint display.
2. Set the Logical operator between watchpoints option.
The default value is always OR .
Changing Watchpoints
1. Choose Goto  Control debugging  Watchpoints or the Watchpoints pushbutton to display the watchpoint list.
2. Choose the pencil icon in the line containing the watchpoint you want to change.
3. Change the watchpoint attributes in the Create/Change Watchpoint.
3. Choose ENTER .
Deleting Watchpoints
You cannot delete watchpoints by choosing Breakpoint  Delete or Breakpoint  Deactivate/activate. Instead, proceed as follows:
1. Choose Goto  Control debugging  Watchpoints or the Watchpoints pushbutton to display the watchpoint list.
2. Choose the trashcan icon in the line containing the watchpoint you want to delete.
Memory Monitoring with Watchpoints
You can use watchpoints to display changes to the references of strings, data and object references, and internal tables. By placing an ampersand (&) in front of the object name, you can display the reference in question in hexadecimal format. With internal tables, you can also display the table header by placing an asterisk (*) at the beginning of the name.
&objectname Displays the references of strings, internal tables as well as data and object references
*itab Displays the table header of the internal table itab
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
2007 Aug 31 1:49 PM
Hi,
This PDF will complete information abt Debugging concept in abap.
http://www.sappro.com/downloads/Settings&SystemAreas.pdf
http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
Debugging Program with ABAP Debugger
Activate the Debugger before executing your ABAP program
System -> Utilities -> Debug ABAP/4
The purpose of the debugger is to allow you to execute your program line by line. It also allow you display the data as you execute the program. (double click on the varaible field name and it will be display)
or after program have been executed,
Run transaction SM66 and find your work process.
Select the line of your work process and double click on it
Click the debugging option.
If this is a custom program, you can put a wait statement in the code to buy yourself some time.
-
1) To understand the Watchpoint, you have to play with it.
a) Debug your program.
b) Place your cursor on the field you want to watch
c) Press Shift+F8, or click the Create Watchpoint button
d) Select the LOCAL WATCHPOINT checkbox if you want the watchpoint to be active for the immediate program only (and not includes etc. By default, you want to leave this unchecked).
e) Drop down on the relational operator, and choose one. They are self-explanatory. (For this example, use '=')
f) Select the COMPARISON FIELD checkbox if you want to check the field against another field, else leave unchecked if you want to check your field against a static value.
g) Enter your comparison field (if you checked the previous box) or your check value in the last box. Once your selected field equals the selected value, the program will break as if a breakpoint was reached. It is possible that the program never breaks, meaning your watchpoint criteria was never satisfied (For example if you check Itab-Field = VALUEA, if Itab-field never have a value equal to VALUEA the program will NOT break.)
2) I use SQL Trace is used for analysis, then based on the information retrieved I do manual tuning
Regards,
Kumar.
2007 Aug 31 5:43 PM
break points are of two types.
external brek-point
internal break point.
internal break-point.
they are basically confined to a user only.if u are putting a breakpoint and somebody else is running the program he cannot c the debugger coming.
if u hardcode BREAK-POINT it is universal.
Watch point is to watch any fix value. if u have 10 values and u want to watch one value in loop place a watch point and when that point comes system will notify u.
putting break point internal is always better. but in forms u have to hard code it.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo