You want to use the SAP code inspector (transaction SCI) to analyze your ABAP code. If you only use a single file, for example a report without any includes this works straight forward. Just select the code file in the section Object Selection and run the inspection. Refer to the documentation of the code inspector for more information on how to create and run a code inspections.
If your code uses includes you have the problem that the included files are not analyzed by this run.
Only the single selected file is analyzed.
The question remains:
How do I get the complete set of code files analyzed?
You can define an Object Set for your inspection to include more files in the analysis.
My first idea was select the package containing my program in the Free Obj. Choice tab of the section Object Selection. This causes a code analysis for an extremely large number of standard includes, which usually ends in a time out before the code of interest, that was my original report, was analyzed at all. The same happened when I tried to generate an object set explicitly naming my program and the five include files. A possible way to handle this problem is described in R. van de Kerkhof‘s very nice blog on excluding standard includes.
A different approach can use standard object collectors, that can be defined in the Obj.Collectors tab.
If you have done a runtime measurement before, for example with SAT, you can use the result of your runtime measurement to indicate which files should be included in the code inspection.
On selecting the option Program from Runtime Analysis you can select one of the runtime measurements available on your system. All code files that are visited during the runtime measurement are now evaluated in the code inspection.
Usually you are only interested in the inspection results related to code you own. To exclude other packages from the displayed results use filters.
The effects on the inspection results
With the steps described above you get from too few files in your inspection:
To all files that are called in your program:
To to all files in your package that are called by your program:
I hope my first blog will help you on defining object sets for code inspections. Comments, suggestions, and improvements are very welcome 🙂 .