Quantcast
Channel: SCN : Blog List - ABAP Development
Viewing all articles
Browse latest Browse all 943

Customizing Code Inspector

$
0
0

Introduction:

 

  Precaution is always better than cure!! Although this is an old thought, has very special meaning and same I thought to apply while working as developer in SAP ABAP.

In spite of facing problems with development after releasing them in production why not to review the code in Development environment with less manual intervention and high accuracy. While exploring to the various checks provided by SAP I came across a very powerful code review tool Code Inspector, and it was what I was searching for.

 

About Code Inspector:

 

  Code Inspector is a powerful tool provided by SAP to review the objects developed through following Tcode - SE11, SE24, SE37, SE38, or SE80. Code Inspector is mainly for the static analysis of ABAP programs and other SAP repository objects.

Code Inspector provides the detail analysis with appropriate message and line number.

 

How to customize Code Inspector:

 

Code Inspector can be customized by following steps:

  • Create the code inspector variant in SCI.
  • Make the variant as default variant.
  • Send the result of code inspector in Email.

 

Creating Code Inspector Variant

   

       Code Inspector variant is created with tcode SCI. When you create the variant you have the option to select the checks as per your requirement and standards:

 

 

1.      Create the global variant in SCI.

  1.png

2.  Customize the checks as per user requirement by creating this variant. It might possible that all the SAP provided classes has not been selected. You can add extra checks by selecting the required classes this can be done as:

            SCI -> Goto ->Management of -> Test Console

2.png

       From this list check the class that you want to make part of your variant and save.

 

     3. While creating variant select the checks you want to perform and provide with necessary input parameters. Information of the checks can be  

          obtained by clicking the  information icon as:

3.jpg

 

     4. Expand each of the check categories to view all the sub category checks. Parameters can be set according to your requirement. For example- In

          Programming conventions category , for check naming convention , you can set the syntax or convention check as per your project standard as:

4.png

 

       Similarly other input parameters can be set for different checks.

 

Creating Your Own Checks

 

   There might be requirement where you want to add your checks as per your need and that check is not provided by SAP defined class. Don’t worry there is everything in SAP you just need to explore it.

   This can be achieved by creating own class and writing your own rule. To know more follow blog:

code-inspector--how-to-create-a-new-check.

 

Making Variant as Default Variant

 

  Instead of executing the code with your own variant in SCI, you can make your created variant as default. That is every time you check the code inspector your variant will get executed. This can be done as:

Go to transaction 'SE16', at the table 'SCICHKV_ALTER', set the item DEFAULT flag and click on EDIT BUTTON.

Change the field 'CHECKVNAME_NEW', 'RESPONSIBL', 'CREADATE' and click on SAVE BUTTON.

 

Sending Result in Email

 

  You can send the result of the code inspector in Email. Execute the code inspector. At the result screen, click the result list option, on result list screen click the mail recipient where you can add the recipient mail and send the result.

  You can customize code inspector as per your need by further exploring it and thus you took precaution of your code before it could raise any harm.

 

     

          


Viewing all articles
Browse latest Browse all 943

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>