Back to blog

Modifying Code Inspector Checks

Gautam Totekar
Friday, May 25, 2018

Introduction to Code Inspector

Every object developed in SAP needs to adhere with certain basic programming guidelines. These Guidelines are based on recommendations by SAP over good programming practices for Optimum System performance. The Guidelines may differ based on whether the concerned system is an ECC system, S4 HANA system or an ECC system on HANA DB. SAP provided various Tools and Techniques for developers to adhere to these guidelines.

The Code Inspector is one such tool that checks static ABAP Objects and DDIC objects for functional correctness, performance, security, reliability, and statistical information.

The Tool allows developers to adhere to programming standards and guidelines by creating messages on less-than-optimal coding. The Tool allows various ways by which the objects or set of objects that can be checked.

a) Single object checks from the Development Workbench (se80,se38,se11)

b) Checks on transport objects from the Transport Organizer (se10, se09) 

c) Checks on sets of objects from transaction SCI 

Every SAP customer must make use of Code inspector checks during development of an Object. It is also needed to perform extensive code inspector checks on Custom code during Upgrades or HANA DB migrations. Some customers also enforce Code Inspector Checks on Transport Request before release to Quality/Production systems.

SAP by default provides a Default variant that has these set of Guidelines. In most cases it is needed to include more guidelines to these default Variants. This document explains how to modify the standard SAP default variant and to change the priority of Code inspector check messages (error to warning or vice versa). The objective of this document is to handle any Customer specific changes which are needed on the Code Inspector variant. In most scenarios a Customer may want to include a newly available code inspector Check while running the Check on the development object without having to go to SCI transaction every time. In other cases a code inspector may generate a warning message. But as per the Customer’s coding standards the warning message is a must fix and hence needs to be converted to an error. Both these scenarios can be effectively handled by the steps described below.

The SAP Default Variant

This section shows modification to SAP default variant to add any additional Checks not included within Standard SAP.

Table SCICHKV_ALTER shows the Default check variant used by SAP for Object and Transport Checks.

The default SAP Variant assigned currently is named ‘DEFAULT’. This variant is used by SAP whenever the objects are checked for Code inspector messages via SE80, SE38 or SE11.

The Other Check Variant record which says ‘TRANSPORT’ is used in SE10 when we check a Transport Request for Code Inspector Messages.

We will be concentrating in this section only on changing the DEFAULT variant that is used for checking Code inspector messages.

Go to Transaction SCI.

Toggle Variant settings to Public.

Code Inspector Checks Modification

Copy the DEFAULT variant from SAP into Custom Variant with suitable Name as in this case Z_NEW_DEFAULT.

Click on Change Button. Modify the Message selection based on the settings needed. Select Transportable Checkbox (Please note that only Check variants marked as Global can be selected as Transportable)

Code Inspector Checks Modification

Once the Custom Check variant has been updated for desired selection save the Check variant and provide Transport details.

Update the Table ‘SCICHKV_ALTER’ Default record with newly created Variant.

Henceforth Code inspector will use the newly updated Variant for checking Objects via se38, se11, se80 etc. Also similar process can be used to update the variant for Transport Check.

In case of Further questions Ref. SAP note 1465965

Modifying Message Priority (Error, Warning and Information)

Refer Demo Custom Program below.

Code Inspector Check on the program runs few Messages as shown below.

Code Inspector Checks Modification

As we can see above there is one Error and one Information message. The code inspector allows us to reduce the priority of Error message to Warning or change the priority of Information message to Error.

Go to SCI-> Management of -> Message priorities.

Code Inspector Checks Modification

Traverse through the Dropdown to reach the message type. Here we will be modifying Error Message to a warning. Click on the Red icon (for error).

Edit Message priority to warning and save.

Code Inspector Checks Modification

On re running the code inspector check on the Demo program it shows that the Error message has been changed to Warning.

In context of S/4HANA

Although the above section depicts how we can modify a SAP Standard default variant for checking individual objects (SE80, SE11, SE38), the same approach can also be used for changing variant used in code inspector checks during Transport Check (SE10) as well. This can be achieved by simply changing the variant name in table ‘SCICHKV_ALTER’ against the TRANSPORT record.

The above process of modifying Code inspector checks is shown for an ECC system but is also valid for an S/4HANA System.

Gautam Totekar is a SAP Technical Analyst at SBP Consulting.

Get a Quote

Your business efficiency is our top priority. We have a full suite of customizable solutions and services designed based on your unique business demands. Simply click on the button below to get a quote for your next project.

 
GET A QUOTE