Show TOC

Special Checking Tasks in the Code InspectorLocate this document in the navigation structure

Procedure

This section shows how to do several useful quality checking tasks with the Code Inspector.

Reviewing Saved Results

The Code Inspector saves the status (successful, aborted) and results of inspections up until their Deleted on dates.

To review saved results, do the following:

  1. Click on the toggle Local to review results of private inspections, visible only to you. Or choose Global to see the results visible to everyone in the system.

  2. Click on the F4 icon at the Name field in the Inspection frame on the start screen of the Code Inspector (transaction SCI).

  3. The Code Inspector displays a window with the available inspections. The highest version number is of course the newest instance of an inspection.

    Click on an entry in the list to fetch the inspection. You can then select Results to see the saved results.

Automating ABAP Unit Tests

The Code Inspector provides a convenient way to automate ABAP Unit testing. You can, for example, run ABAP Unit tests automatically every week after transports arrive, in order to do regression testing and verify new functions.

Note

You will find a weblog in SDN with detailed instructions for setting up automated ABAP Unit testing with the Code Inspector (English only): http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/16420Information published on SAP site

To set up automated ABAP Unit testing, do the following:

  1. Define an inspection and select the programs whose ABAP Unit tests should run.

  2. Define a check variant in which you mark only Dynamic Tests in the List of Checks.

  3. Choose ... (Execute) to run the inspection. Fill out the execution options as shown here:

    Figure 1: Batch Execution Options
  4. Confirm your choices. On the next screen, you can enter the start time and repeat interval of the Code Inspector job. The job will automatically repeat the ABAP Unit tests that you have selected.

Searching for Particular Words in ABAP Entities

Do you want to look for use of obsolete ABAP statements? Or do you need to enforce a change in terminology in coding? The Code Inspector can help you with these tasks.

  1. In a check variant, mark the section Search Functs.

    With the check Search of ABAP Tokens, you can look for text strings in literals, comments, and in active coding. Enter the search string by clicking on the Selection button.

    SAP recommends for best results that you start and end the search string with the wild card character: *string to search for*. The search is case-insensitive.

    With the check Find Unwanted Language Elements, you can search for ABAP statements that are obsolete in modern ABAP OO programming. The check is delivered with a pre-selection of statements.

  2. Save the check variant and use it to search for texts and statements that you wish to change.

Sending Lists of Messages by E-Mail

The Code Inspector e-mail function ( Start of the navigation path Utilities Next navigation step SAP Internal Next navigation step Send Mail End of the navigation path) is not active in customer systems.

But you can still send lists of messages to users. This is a good way to report results from a consolidation system to developers who work in other systems.

  1. Generate a results list that is suitable for a user or group of users.

    For example, you can inspect development packages and send the results to the developers who work on the package.

  2. On the Code Inspector: Results screen, choose the Results List function to display the messages in ABAP list format.

  3. Choose the Mail Recipient to open the mail window.

    For R-Mail within the SAP System, you can specify a user ID as the Recipient and B SAP Logon Name as the Recip. Type.

    For external Internet mail, you can enter an Internet e-mail address (user.name@domain) and U Internet address as the Recip. Type. For external mail, SAP Connect (transaction SCOT) must be set up.

  4. Press Send dispatch the mail.

Automatically Checking Transport Requests on Release

You can have the Code Inspector automatically check the objects in a transport request when the request is released.

To activate this feature, do the following:

  1. Start the Transport Organizer Tools by entering transaction SE03.

  2. Choose Start of the navigation path Transport Organizer Tools Next navigation step Administration Next navigation step Global Customizing (Transport Organizer) End of the navigation path.

  3. In the Check Objects when Request Released frame, mark the Globally Activated option.

The Code Inspector will automatically start when a user releases a transport request. (The Code Inspector does not run if a user releases a task within a transport request.)

The user will see a status message reporting that the Code Inspector is checking the objects in the transport request. The system DEFAULT check variant is used for the check.

If no check messages are reported, then the release of the transport request is completed, as usual.

If there are check messages, then the user has the option to review and correct them before the release of the request is completed. The user can also override the checks and complete the release of the transport request despite the presence of check messages.