Show TOC

Defining and Running Reusable Code InspectionsLocate this document in the navigation structure

Procedure

This section explains how to create reusable inspections. The definition (name, object set, check variant) of a reusable code inspection is saved. You can run it repeatedly or schedule it for automatic execution as a background job.

Likewise, the results of a reusable inspection are saved. You can compare or track the results over time.

To inspect a large number of objects (more than 50), you must use a reusable code inspection.

To define and run a reusable code inspection, do the following:

  1. Start the Code Inspector with transaction SCI.

  2. Enter a name for your inspection in the Name field in the Inspection frame and choose Create or Change.

    Click on the toggle Local for a private inspection, visible only to you. Or choose Global to create or choose from an inspection visible to everyone in the system. You have the same choice for object sets and check variants.

    You can also create a new version - Create New Version- of an existing inspection and run it right away, without changing the object set or variant. .

    For more details, click here.

  3. Define the object set - the programs and objects to inspect.

    You can choose an existing object set. Or you can define a new object set by entering a new name in the Object Set field and double-clicking for forward navigation.

    You can also inspect the objects in a transport request, or specify programs or other components by name.

  4. Define the check variant - the checks to be done in the inspection.

    You can choose an existing an existing variant or define a new variant by entering a new name in the field in Check Variant frame.

  5. Run the inspection.

    Choose Execute to run the inspection while you wait in your current session.

    Choose ... (Execute) to run the inspection asynchronously. The most interesting option is to run the inspection as a background job. For this, enter a server group (click on Maintain Server Group and mark the In Background (Periodically also) field. With this option, you can run the inspection periodically. This is a good way to run ABAP Unit tests automatically.

  6. Wait for the results. The screen shows when the inspection has finished (you may need to refresh the screen with Display <-> Change). You will see one of these icons next to the Inspection field.

    • Scheduled The inspection has not yet run or has not yet been completed.

    • Executed The inspection finished successfully.

    • Cancelled The inspection aborted (the background job or asynchronous execution failed). There are no results.

    You can also pick up the results later. Just use the F4 Possible Entries function of the inspection Name field to access inspections that have already run.

  7. As soon as the Executed icon shows, click Results to see the results screen.

    Here, the display is opened to show an error and two warnings. These are in the categories Analysis of WHERE Condition for SELECT and Low Performance Operations on Internal Tables.

    Figure 1: Useful Functions in the Code Inspector Results Display
  8. If you would like to re-check the objects after making corrections, just click on the Create New Version button.

    The Code Inspector creates a new version of your inspection, and you can run it again.