Skip to Content
In this blog I would like to talk about the “Code Inspector” tool and how it can be used to enforce naming conventions and coding standards in ABAP programs. The  Code Inspector (transaction code SCI) is a very powerful tool  which can be used to check individual objects or sets of objects for performance, security, syntax, and adherence to name conventions. You can also determine statistical information or search for certain ABAP words (tokens). In the Code Inspector, you can define inspections that, with the help of check variants examine certain sets of objects. As the result of an inspection, you receive information messages, warning messages, or error messages on different properties of the examined objects.           Steps  1. Go to SCI transaction.image2.Creation of object set Give a name to the object set and select “create”. Object Set can be used to group several single objects together for an inspection. Sets of objects include, for example, programs, function groups, classes, or DDIC objects. In general, any Repository objects can be included in a set of objects.Here you can either include a entire package or individual programs. image3.Creating the Check Variant Give a name to the check set and select “Create” With the help of the check variant, sets of objects included in the object set are checked as to whether or not certain criteria have been met.This variant can be used to enforce performance checks,syntax checks,security checks,naming conventions and ABAP keyword searches.In this example I create a check variant for enforcing program naming conventions and ABAP Keyword searches. image4.Naming Conventions Click on the “naming conventions” node under the “programming conventions” node.A popup screen will be displayed as shown below where you can define the naming conventions for various ABAP objects. image5.Searching for ABAP tokens Click on the “Search for ABAP Tokens” under the “Search Functions” node.A popup window will be displayed in which you can specify any specific ABAP keywords to be filtered.In this example I am searching for the ABAP keyword “LIKE” which I don’t want to be used in any of the checked programs. image6.Attaching the object set and the check variant to the code inspector Now come back to main screen in SCI and create a new code inspector by selecting “create” under the “inspection” frame.Here you attach the “object set” and “check variant” created in the earlier steps.image7.Save and Click the “Execute” button to generate the result. 8.Click on the “results” button  to view the result You can double click on the results to go to the main program. image9.Test program  for checking naming conventions       enforced in check   variant.
To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

    1. Anonymous
      That is one of the problems in the code inspector.I think SAP should be addressing it in the future versions
      (0) 

Leave a Reply