Checkpoints
The BREAK-POINT statement defines an unconditional checkpoint. When the program execution reaches an active breakpoint, the program flow is interrupted and the debugger starts. You can activate breakpoints and create them without assignment to a checkpoint group.
The ASSERT statement defines a conditional checkpoint. It is always linked with a logical condition. When an active assertion is reached, the system checks the logical condition. If the condition is not true, the assertion is violated and the system terminates the program with a runtime error or dump. If assigned to a checkpoint group, you can select a different response for violated assertions
The LOG-POINT statement defines an unconditional checkpoint that serves merely to log when execution reaches a certain point in the source code. A logpoint never interrupts or terminates a program. Logpoints must always be assigned to a specific checkpoint group, whch means they can always be activated.
Breakpoints
You can start the Debugger when an ABAP program is executed by creating a breakpoint. Breakpoints are places in the program that instruct the ABAP runtime processor to interrupt program execution at a specific place in the source text. The Debugger is not activated until one of these positions are reached. To set a static breakpoint, use the BREAK-POINT ABAP keyword. Set the breakpoint at the line where you want to interrupt the program.
Note: In contrast to static breakpoints that are a part of the source code, you can also set dynamic breakpoints. Dynamic breakpoints are user-specific and they are set in the ABAP Debugger.
Assertions
In order to debug and analyze complex programs, you can implement breakpoints and assertions. Assertions verify certain assumptions about the program state at a specific place in the program, and ensure that these assumptions are fulfilled. A new ABAP statement, ASSERT, was introduced by SAP for this purpose. The syntax of ASSERT is ASSERT <log_expr>.
Advantages of Assertions
If the logical expression is not fulfilled, the assertion is violated, and a runtime error is raised. In contrast to an IF query, the ASSERT statement is shorter, its purpose is directly recognizable, and it is activatable.
Assertions help you check whether the program flow is progressing the way that is intended. The program reacts if its results, or interim results, lie outside of a range of expected values.
Activatable Checkpoints
You can design assertions and breakpoints which, instead of being unconditional, are only analyzed by the system under certain circumstances. To do so, assign a checkpoint group to the BREAK-POINT and ASSERT statements by using the ID addition.
Checkpoints |
Always Active |
Can be activated |
Breakpoint |
BREAK-POINT |
BREAK-POINT ID <grp> |
Assertion |
ASSERT <log_expr> |
ASSERT
ID <grp> FIELDS <f1>....<fn> CONDITION <log_expr> |
Logpoints |
Not possible |
LOG-POINT ID <grp> FIELDS <f1>....<fn> |
Checkpoint Groups
Checkpoint groups represent a new type of Repository object. They can be created in the Object Navigator, or in transaction SAAB (be sure to observe the naming convention).
Maintenance Screen of Transaction SAAB
You can activate and deactivate breakpoints and logpoints in the maintenance screen of transaction SAAB .