Why do we need to debug: BREAK POINT

Definition:


The BREAK POINT is a debugging aid. When we run a program normally, it is interrupted at the statement, and the system automatically starts the debugger, allowing you to display the contents of any fields in the program and check how the program continues. If the program is running in the background or in an update task, the system generates a system log message. 

Break point types:

  1. Static
  2. Dynamic
    1. Directly set
    2. Specially set
                                                              i.      At statement
                                                            ii.      At event
                                                          iii.      At function module
                                                          iv.      At system exceptions


Static Breakpoint


Written in ABAP program.
Should be used in development environment only.

            If sy-subrc eq 0.
            break-point.
            endif .

Dynamic Breakpoint


  • User specific.
  • Can be set/deactivated/deleted at runtime.
  • Deleted automatically when the user logs off from R/3 system.
  • Can be set even when a program is locked by other programmer.
  • Logics can be built while defining it.

Different ways of putting the Break-point in the Program


1)      Writing the Break point in the program.
2)      Writing the Break statement along with the user name in the program Break sy-uname.
3)      By Clicking the Red Button on a line, one can create the Break point at that line.

How to Create/Delete Break Point



  • You can set the break point by duble clicking on the statement during the debugging in
  • You can set the break point through menu option: place the cursor on the statement where you want to put the break point.
    • Goto the menu bar > Break point > select the Create/delete.
  • After creating the break point select Ctrl+S / Select Save in the menu bar - to save all the break points for that session.
  • Viewing all the break points in a ABAP Program.
    • For viewing all the break point in the ABAP Program: Goto – Utilities - Break points - Display
  • If we want to delete the selected break point then click on the display selected Object.
  • After deleting all the break points, the table will be empty and no break point is left in the table.

How to Activate/Deactivate Break point

1. Activate/deactivate all: It will activate the single deactivated break point and vice-versa.
2. Delete All: It will delete all the break points, which is in the programs
3. Deactivate All: It will deactivate all the break points in the program.
4. Activate All: It will activate all the deactivated break points.
5. Save: After setting the break point, by clicking the save button it will save the break point in the program.
  
One can put a break-point at a Statement, Subroutine, Function Module and exception always at runtime.
If in a specific program there is one function module and two subroutines, in that case
The Program will stop at the statement select.
The Program will stop at subroutine.
            The Program will stop at Function Module

1 comment: