The Need for Debugging
There is no way around the fact that errors occur in programs. However, they manifest themselves in different ways. When a user starts a faulty application, it may crash, something unexpected may happen, or nothing at all may happen. From the user's point of view, at user interface level, it is impossible to say just how and why this error occurred.
As a developer, you now need to examine the program more closely, line-by-line in fact, to establish just what statements and combinations of values in the different program variables caused the error. This is where the Debugger comes in.
Runtime Errors

It is important to perform a syntax check regularly when writing ABAP code. However, correct syntax does not always mean your program will execute successfully at runtime.
For example, calculations in your program may cause a problem depending on the values used. The figure, A Syntactically Correct Program Can Have Problems, demonstrates a program that, while syntactically correct, will cause a runtime error.
ABAP Short Dump

If the runtime environment encounters a statement that cannot be executed, it terminates the program and triggers a runtime error. Each runtime error is identified by a name and assigned to a specific error situation. The runtime environment terminates the program if a runtime error is not caught. The ABAP Runtime Error can be displayed in the ABAP Runtime Error Viewer as of ABAP 7.53.
The ABAP Runtime Error Viewer can be opened using different entry points:
- If the error occurs while running the ABAP application, a dialog appears in the bottom-right corner. Choose Show to display the error.
- In the Feed Reader view, double-click on the runtime error entry.
From the toolbar, you can navigate to the source code position where the dump occurred and share the link to the dump.


There are three tabs at the bottom of the editor:
The first provides the following information:
- Header information
- Error analysis
- Information on where the program terminated
- Source code extract
- The line in which the error occurred is highlighted; choose the line to navigate to the error in the source code
- Active calls/events
The Long Text tab provides the full dump information. It supports the features, Outline and Quick Outline (Ctrl+ O on your keyboard).
The Unformatted Display tab provides the dump information in a technical format that is only necessary for special analysis situations.
A short dump also allows you to navigate directly to the ABAP Debugger to see the values of variables just before the runtime error occurred.
Runtime errors are normal. You will probably encounter them frequently while developing your programs. However, it is important that you try to prevent them. A user in your production system may be confused if they see a runtime error, such as the error in the figure. The user may not understand a reference to the ABAP application and the presented technical information.
Avoiding Runtime Errors


In the above example, logic was added to avoid the division by zero runtime error.