Before jumping to the difference between a Static Breakpoint and Dynamic Breakpoint, let’s have a short introduction of the two.
What is a Breakpoint in SAP ABAP?
A Breakpoint is a signal in a specific line of the ABAP program that interrupts the normal execution of the program and the control is transferred to the Debugger. A breakpoint can be active or passive at runtime and can be set for the specific users, all users or based on checkpoints. Breakpoints help in debugging and analysing ABAP Objects, ABAP programs and evaluating only the concerned sections of ABAP code, while skipping the rest of the areas.
Static Breakpoints are recommended for use only during the development of an application where the program execution needs to be interrupted at the same point for analysis. These must be deleted once the development phase is over. These are set by an ABAP statement and can be of the following types:
- User non-specific: These are inserted by the ABAP keyword BREAK-POINT. These are applied to all users and the system interrupts the execution for all the users.
- User-specific: These are inserted by the ABAP keyword BREAK <USERNAME>. These are applied to the specified user and the system interrupts the execution for the specified user.
Dynamic Breakpoints are triggered when the program that you are running reaches a particular ABAP statement or exception class. These are user-specific and gets automatically deleted when the user logs off. A total 30 dynamic breakpoints can be set without changing source code.
Dynamic Breakpoints are more flexible than Static Breakpoints as the former can be created, deactivated or deleted at runtime. Dynamic breakpoints can be set even when the program is locked by another user.
Now, let’s have a look at their difference.
Difference between a Static Breakpoint and Dynamic Breakpoint
|Static Breakpoint||Dynamic Breakpoint|
|They can be set using statement “BREAK-POINT” and “BREAK <USERNAME>” in ABAP code.||They can be set in ABAP editor and in debugging mode.|
|These are not normally user specific; but can be set for specific users.||These are user specific.|
|These cannot be set when the program is locked by another user||These can be set even if the program is locked by another user.|
|These needs to be deleted manually.||These are deleted automatically when you log-off from SAP.|