SAP CODE INSPECTOR - Guide
Get Example source ABAP code based on a different SAP table
Code Inspector
ABAP_BACKGROUND
The Code Inspector tool performs a static check of repository objects regarding performance, security, syntax, and adherence to naming conventions. Transaction
Code Inspector can also be called from ABAP Workbench to perform a standard set of checks for the current object, for example by choosing
As in the extended program check, the results of Code Inspector are divided into three categories (errors, warnings, and simple messages), which you can hide using special pseudo comments.
ABAP_RULE
Perform the standard check variant of Code Inspector before releasing a program, and correct all error messages.
ABAP_DETAILS
If the
Compared with the messages of the extended program check, it is not always so easy to correct these problems at their source, perhaps because there is no other option for a selection, or because the transparency or robustness of a construct is seen as more important than a small potential loss of performance.
In such cases, the messages can be suppressed using the appropriate pseudo comments. A pseudo comment is a clear indication to the reader of a program that the program author has performed the relevant checks and has explicitly suppressed the message for a good reason. If necessary, pseudo comments can be substantiated by additional regular
ABAP_EXAMPLE_BAD
A standard Code Inspector run for the example class below issues warnings because an internal table is returned by pass by value and an inner join for database tables with activated table buffering is used in the
ABEXA 00874
ABAP_EXAMPLE_END
ABAP_EXAMPLE_GOOD
The source code below shows the corrected version of the above class, for which Code Inspector no longer issues any messages.
The pass by value of the internal table is replaced by a pass by reference. When passing the elementary parameter
The inner join of the
ABEXA 00875
ABAP_EXAMPLE_END