The system checks ABAP programs statically when you create them and dynamically when they are running.
In the static checks, the syntax check tests the syntax of the program, and the extended program check performs a semantic check (including, for example, checking whether the number and type of the interface parameters in an external procedure call is correct).
The syntax check checks the syntax and internal semantics of a program. When an error occurs, the check stops, and the system generates an appropriate error message. A dialog box often appears, in which a proposed solution is displayed. Choose "Correct" to adopt this proposed solution in the program. The system then repeats the syntax check.
When you run a syntax check on an include program, the system combines it with the Top include of the program before checking it. The system only checks all of the includes belonging to a program for consistency and completeness (for example, ensuring that all of the subroutines called from the program have actually been defined) when you run the syntax check for the main program.
The syntax check may generate warnings. In this case, the syntax check does not end immediately, and you can, technically, run the program. However, you should always correct syntax warnings, since they could cause unforeseen errors when you run the program and could also become a real syntax error in future releases.
Many checks are excluded from the standard syntax check for performance reasons. The extended program check performs a complete check that includes the interfaces of external procedures called from your program.
Errors in the extended program check cause exceptions when you run the program which, in turn, lead to runtime errors. You must therefore correct them. The exception to this is coding that cannot be reached. However, you should delete this to minimize the size of your program and make the source code easier to understand.
Warnings in the extended program check should also be corrected. If your program contains statements that are definitely correct but still produce warnings in the extended program check, you can exclude them from the check using pseudocomments ("#EC ...).
You should always run the extended program check on a new program. You have not finished developing a new program until you can run the extended program check on it without any errors or warnings. Messages are permissible, since they are generally not critical.
The extended program check is also only a static check. It cannot eliminate all of the circumstances that could lead to exceptions or runtime errors. For example, any statements in which you specify arguments dynamically as the contents of fields, or in which you call procedures dynamically, cannot be checked statically.
Errors that cannot be detected statically and that occur at runtime are detected by the ABAP runtime environment. Such errors lead to exceptions. If an exception is not handled or cannot be handled, a runtime error occurs. If such a runtime error occurs, the ABAP runtime environment terminates the program, generates a short dump, and switches to a special screen from which you can analyze it.
Short dumps are divided into blocks describing different aspects of the error. In the overview, you can see what information is contained in the short dump, for example, the contents of data objects, active calls, control structures, and so on. The short dump overview also allows you to display the point in the program at which the termination occurred in the ABAP Debugger.
The following kinds of errors can occur:
· Internal error
The kernel encountered an error. In this case, inform SAP.
· Installation and environment or resource error
An error that occurred due to incorrect system installation or missing resources (for example, database closed).
· Error in application program
Contents of a numeric field have the wrong format.
External procedure does not exist.
Type conflict when passing parameters to an external procedure.
Short dumps are retained in the system for 14 days. Use Transaction ST22 to administer short dumps. If you want to retain a short dump beyond the default 14 days, use the Keep function. If you want to delete short dumps by a date criterion other than the default 14 days, choose Reorganize. If you display a short dump using Transaction ST22, you cannot branch to the Debugger.
If problems occur in an ABAP program that you cannot solve yourself, you can send an extract of the short dump to SAP. The contents of the short dump are essential to the SAP Hotline and Remote Consulting to enable them to solve your problem.