Debugging in SAP ABAP
ABAP Series Part- 6
In this blog, I will discuss What is Debugging in SAP ABAP is and How to debug a program.
In most of the language we came across Debugging for the Program, But why do we use this?
At the time of execution of code, if it gives a dump or runtime error then a debugger is a tool to check your lines of codes and examine errors during runtime. In SAP ABAP Debugging helps a programmer to check his program flow at runtime.
But What is the Actual Definition of Debugging?
Debugging is the process of analyzing the flow of a program to locate and reduce defects or bugs. In the source code of an ABAP program, the debugger helps you to detect and correct errors by steps of each checking.
- How can we Debug?
1. Setting up a Breakpoint.
- A Breakpoint is a signal in a particular line of the SAP ABAP program that interrupts the normal execution of the program and the control is transferred to the Debugger.
2. Running the program in debugging mode.
- /h command in command prompt in any screens.
There are 2 types of BreakPoint.
- Static BreakPoint
- Dynamic BreakPoint
- Static BreakPoint
- It must be written in a line where we want to set BreakPoint.
Keyword: BREAK-POINT. - We can give user-specific BREAK-POINT/
Keyword: BREAK <USERNAME>
2. Dynamic BreakPoint
- In these, we set a breakpoint in the line which we want without hardcoded the keyword. Also once debugging session is executed fully it will get deleted automatically.
- For debugging in a particular line, we need to put a cursor on the line. ( 2nd Line)
- Or By Go to More -> Utilities-> Breakpoint-> Set/Delete Session BreakPoint.
- In Debugging Mode these are specific keys that are used.
F5- Executes a program line by line.
F6- Executes a function module or a subroutine without entering into it.
F7- Executes a module or a program in a single step.
F8 — Executes a program directly. If there is more than one break-point, they can move from one break-point to the other.
Dynamic Breakpoints are more flexible than Static Breakpoints as the former can be created, deleted at runtime.
Conclusion
In the article, I give a detailed view of Debugging concept in SAP ABAP.
Thanks for reading.
If you Want to Connect with Me:
LinkedIn: https://www.linkedin.com/in/mayank-chourasia-38421a134/
Twitter: https://twitter.com/ChourasiaMayank.
Thank you, stay safe, stay healthy.
Soon Starting a series on SAP ABAP on HANA.
Stay tuned till the next blog.