CALLING THE CODE INSPECTOR DIRECTLY FROM THE ABAP EDITOR
The Code Inspector enables you to check your programs for performance, security, and typical semantic errors. There are various ways of calling this tool. As shown here, one method is to choose Program, select Check, and then select Code Inspector. After this, you can commence a standard inspection for your programs.
You can also call the Code Inspector from the context menu in the object list.
After carrying out an inspection, you get a list of errors and warning messages. If you select the information button that is next to a message, it gives a detailed description of the error, along with the suggested improvements. If you double-click the error text, it shows the corresponding program statement.
The Code Inspector uses a default check variant with predefined checks. This default check variant contains
extended syntax check;
check of critical statements (such as C calls or Native SQL); and
selected performance checks.
To overwrite this default check variant, create a new check variant with the name DEFAULT. However, the new check variant will override the standard variant for the users.
The standard variant is used automatically for any future checks in the absence of the default check variant.
DEFINING COMPLEX INSPECTIONS IN TRANSACTION SCI
You can define a custom check by calling the Code Inspector with either the transaction code SCI or by choosing Tools, then ABAP Workbench, then Test, and finally Code Inspector.
The initial screen where you describe custom checks consists of three areas:
The Inspection field contains the name of the actual check. If the name is not specified, the results will not be saved.
The Object Set field defines the Repository objects that will be checked.
The Check variant field defines the checks that will be performed.
CREATING A CHECK VARIANT
A check variant contains one or more check categories, which in turn consists of one or more single checks. These single checks pertain to various check categories:
General Checks contain the checks for data formatting, such as the list of table names from the SELECT statements.
Performance Checks contain the checks for performance and resource usage, such as the analysis of the WHERE condition for SELECT or UPDATE and DELETE.
Security Checks contain the checks of critical statements, cross-client queries, and insufficient authority checks.
The Syntax Check or Generation contains the ABAP syntax check, an extended program check, and generation.
Programming Conventions contain the checks of naming conventions.
Search Functions contain the searches for words and the statements in ABAP source code.