Carrying out quick code inspection

In this recipe, we will see how we can do a quick code inspection on a single program or an object set. This is also termed as an Ad Hoc Inspection, since the inspection results are not saved and are not available for future.

How to do it...

We will now carry out these steps:

  1. Call the SAP transaction SCII. Alternatively, you may go to transaction SCI and on the main screen, leave the Inspection field blank and press the Create button below the Inspection Input field. The screen appears as follows:
    How to do it...
  2. Select the Single radio-button option. From the list box, select the Program option and then enter the name of the program in the field provided. We enter the name of a previously created program ZST9_TEST_FOR_ALL_ENTRIES_2.
    How to do it...
  3. From the area in the lower part of the screen, we will select the option Temporary Definition. Then we select from the available checks that we want to be carried out. Selecting or deselecting a particular category will include or exclude all checks within the category in the inspection. For resetting to default values at any time, select the menu path by going to Utilities | Set Initial. Alternatively, use the toolbar button How to do it... or press F7.
    How to do it...
  4. Finally, press F8 to carry out the inspection.

How it works...

The code of the program mentioned is scanned and checked based on the selected checks. The results are then displayed. The results comprise of tree structure (hierarchy) within nodes corresponding to the checkbox selected. There are three columns shown for messages within the different categories and then the checkboxes pertaining to the category in question. These are Errors, Warnings, and Information messages. You may open the various categories to see the detail of the messages found in each category. For example, we have two information messages found under Use of Indexes in SELECT statement.

How it works...

You may double-click on a particular message to reach the actual line of the code in the program that generated the message in question.

There's more...

While selecting the checks to be run from a particular category, a check may have further attributes. This is denoted by the There's more... icon before it. You may click on the icon to view a list of the attributes and choose the ones relevant for your requirement. If you find an icon, it means that there is at least one value that must be set for the attributes contained within the check. Otherwise, selecting the check will produce an error and the inspection will not run.

There's more...

For running another inspection from the results screen, use the toolbar button There's more....

For viewing the results in a compact display format, use the toolbar button There's more....

You have also the option of checking objects using object sets or the object contained within a request. However, the transaction has a limitation that you may not check over 50 objects and that the inspection may not be saved for reuse. In this case, the inspection is not stored and does not have a name (that is, it is anonymous). The next recipe will cover the ones that will overcome these limitations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.220.83