SAP EXTENDED PROGRAM CHECK - Guide
Get Example source ABAP code based on a different SAP table
GUIDELINE 3.7
Extended Program Check
ABAP_BACKGROUND
The extended program check can be called for activated programs either from ABAP Workbench or by using transaction
The extended program check outputs errors, warnings and messages. The standard check outputs errors and warnings that are particularly critical. The classification of individual results (error, warning or message) depends on whether a standard check is performed or explicitly selected individual checks. The extended program check also displays the errors and warnings of the syntax check.
In the initial screen of the extended program check, a programming guidelines check can also be selected. This checks whether certain rules presented in this book (that can be verified statically) have been adhered to.
The messages from the extended program check, which are inapplicable in some special cases, can be hidden using pragmas. Before the introduction of pragmas, it was not possible to hide messages raised by a normal syntax check.
ABAP_RULE
Use the extended program check and take the results seriously. Message are not allowed to appear when the standard check is performed for a completed program.
ABAP_DETAILS
The errors, warnings and messages output by the extended program check are just as important as the syntax errors and syntax warnings from the
In rare cases, when a result reported by the extended program check is not justified, this must be documented using an appropriate pragma (the relevant pragma is indicated in the message). This means that the system suppresses the message of the extended program check. Ideally, in less obvious situations, an additional comment should be used to describe why the message is not applicable.
Note
The extended program check provides useful help for writing ABAP programs in the correct way. Using unspecific pseudo comments or pragmas can undo the positive effect of the extended program check. In particular, the following statement should never be used:
This statement suppresses all messages of the extended program check for an entire source code section.
If the ABAP program is submitted to a code review, the results of the extended program check should be used to evaluate the quality.
Bad example
If the following source code is checked using the extended program check, a warning appears. It indicates a particularly questionable query of the content of the
IF sy-subrc <(><<)>> 0.
...
ENDIF.
The program section shows a typical error in a syntactically correct program. The developer wrongly assumes that the static form of the
Good example
The following source code shows the corrected version of the above example. The predicate expression
IF <(><<)>fs> IS ASSIGNED.
...
ENDIF.