Line by Line Debug
- Step 1: Below I have created a sample program in the name of Zdebug.
- Step 2: Place the cursor on the line and Set Session Breakpoints.
- Step 3: Now execute the program.
- Step 4: Execute Again.
- Step 5: Check the values in output table T_KNA1.
With session breakpoints you can stop and debug requests that you trigger in the same user session where you have set the session breakpoints. They are therefore particularly useful for debugging SAP GUI-based applications.
Debugging is the process of analyzing the flow of a program to locate and reduce defects or bugs. In SAP, the debugging process is applied with the help of ABAP Debugger, a SAP programming tool that is capable of analyzing an ABAP program or object, by line or section, and can even change object values at runtime.
To do this, go to ABAP Editor (SE38)→ Utilities → Settings.
- Now in the user-specific settings pop up box click on ABAP Editor tab and then click on Debugging.
- Here you can select the New Debugger radio button to make it your default debugger.
- External (User) Debugging.
Debugging is the process of finding and resolving defects or problems within a computer program that prevent correct operation of computer software or a system.
If no further external session is available, the Debugger start is cancelled. If you want to debug system programs or screens, choose System → Utilities → Debug System or Debug Screen. 5. To switch to the Classic Debugger, choose Debugger → Switch to Classic Debugger.
Switching between the 'Classic Debugger' and 'New Debugger' You can switch between both the debugger and make any one your default debugger. To do this, go to ABAP Editor (SE38)→ Utilities → Settings. Now in the user-specific settings pop up box click on ABAP Editor tab and then click on Debugging.
activate external breakpoints in sap system. From SE80 , open Utilities->ABAP Editor->Debugging , then enter username that you want to debug externally( it must be a dialog user) . After this click External break-point button in your ABAP editor where you want to put your break-point.
You can implement another type of breakpoint, External Breakpoints for external debugging. You can set one or more external breakpoints for the ABAP program that you later want to interrupt and control with the ABAP debugger. However, an external breakpoint only activates the ABAP Debugger under certain conditions.
Up to 30 session breakpoints, external breakpoints, and debugger breakpoints can be set. A breakpoint is either active or inactive . Only active breakpoints take effect.
Breakpoint Types
- If you set a breakpoint in the ABAP Editor (SE38), then it is a session breakpoint or an external breakpoint . You can also set a breakpoint statement in the source text of the program.
- If you set a breakpoint in the window of the ABAP Debuggers, then this is a debugger breakpoint .
Start your application in debugging mode and then choose menu: Breakpoints -> Breakpoint at -> Method. Enter the global class and the method you want to debug. That's it.
External debugging makes it possible for you to stop and debug ABAP programs that are running in the context of another user's session by setting breakpoints. External debugging covers both situations: The program to be checked is running in a user session of another user other than the one who set the breakpoints.
If you set a breakpoint in the ABAP Editor (SE38), then it is a session breakpoint or an external breakpoint . If you set a breakpoint in the window of the ABAP Debuggers, then this is a debugger breakpoint . Debugger breakpoints can be set in addition in a debugging session that already exists.
You can start the Debugger as follows: From the Object Navigator Select a report or transaction and program and choose Program Test Debugging. From the ABAP Editor Choose Program  Execute  Debugging (or the Debugging pushbutton).
watchpoint. Noun. (plural watchpoints) (computing) A debugging mechanism whereby execution is suspended every time a specified memory location is modified; or, any of various similar such mechanisms.
Just press Watchpoint button and enter the internal table name in the Create Watchpoint popup. The debugger stops when the internal table is changed. You can further refine the watchpoint by specifying a condition (for example stop only if internal table contains more then 200 rows).
button and double click the item titled “Variable Value (for Simple Variables)” under the Variable Information folder. Change the exporting variable P_VAR_NAME to match the variable that you want to set as a watchpoint and change the importing variable P_VAR_VALUE to store the results in your local data variable.
Just press Watchpoint button and enter the internal table name in the Create Watchpoint popup. The debugger stops when the internal table is changed. You can further refine the watchpoint by specifying a condition (for example stop only if internal table contains more then 200 rows).
Both are used in SAP ABAP debugger. While running the program, Basically breakpoint will stop the execution control on the statement where the breakpoint has been set. Watchpoint is used to watch/monitor variable value during program execution.