Show TOC

Doing a Fast Ad Hoc Code InspectionLocate this document in the navigation structure

Procedure

You are editing a repository object in one of these transactions:

  • The Object Navigator (transaction SE80)

  • The Class Builder (transaction SE24)

  • The ABAP Editor (transaction SE38)

  • The ABAP Function Builder (transaction SE37)

  • The ABAP Dictionary (transaction SE11).

And you want to check your program or other object for errors.

Do the following to run an ad hoc check with the Code Inspector:

  1. Start the Code Inspector. Open the left-most 'object' menu of the screen you are on and choose this menu function:

    Start of the navigation path Check Next navigation step Code Inspector End of the navigation path.

    Or mark the program or other entity and use the context menu. The path is the same.

  2. The Code Inspector presents the results of the checks. 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

    Unlike the results of reusable inspections, these results aren't saved. They are deleted when you leave the program. Also, the Code Inspector will object if you try to check more than 50 objects in an ad hoc inspection.

  3. Respond to a result message. You can:

    • Correct the problem. Double-click on the error message to open the editor.

    • Mask the problem if it cannot or should not be corrected. In your code, enter the pseudo comment- if there is one - that cancels the Code Inspector check.

      Click on Documentation or the Exceptions in the results table to see if there is a pseudo comment.

    • Mask the problem with an exception if it cannot be corrected or masked with a pseudo comment. An exception has to be approved by a Quality Manager.

      Not all problems can be masked with a pseudo comment. In these cases, choosing Exceptions instead lets you request an exception. (Where you don't see an Exceptions icon, the check message cannot be masked at all.)

      To request an exception, you need to specify the name of a user authorized to grant it, the scope of the exception, and optionally a comment. Once you save the exception, you can see it from the entry screen of transaction SCI. Choose Start of the navigation path Goto Next navigation step Exceptions Next navigation step Requested End of the navigation path.

      Note: For a complete list of messages with documentation and exception handling, choose Start of the navigation path Goto Next navigation step Management of Next navigation step Message Priorities End of the navigation path. Table entry in the Exception column means that an exception can be requested. Where a pseudo comment is shown, the message can be masked.

Useful Ways to Go On

Here are some useful things you can do from the Results screen of the Code Inspector.

Define Your Own Check Variant

In an ad hoc check, the Code Inspector uses the system-wide DEFAULT check variant to decide what to check.

For future checks, you can create your own personal DEFAULT check variant. The Code Inspector will then use your check variant instead of the system default.

  1. On the Code Inspector: Results screen, choose Create DEFAULT Check Variant.

  2. You will see the checks selected for the system DEFAULT check variant. Mark or unmark the checks to put together the code inspection that you wish to have. You may need to specify check parameters for some tests before you can activate them.

    Note: Marking Dynamic Checks tells the Code Inspector to run your ABAP Unit tests. To this extent, the Code Inspector can do dynamic runtime checks as well as static checks.

  3. Save your personal DEFAULT check variant. The Code Inspector will use it in ad hoc runs from now on.

To use the system DEFAULT check variant again, just use transaction SCI to delete your DEFAULT check variant.

Use a Compact Results Display

For a more compact Results display, try the table display. Click on the Results Table button.

Mail Check Results

Some or all of the problems don't really belong to you? Then you can mail them to the real offender:

  1. Choose the Results list function to switch to the list display.

  2. Choose the Mail Recipient function to enter e-mail addresses and a cover note.

  3. Choose Send to dispatch your results mail.