Skip to Content

The purpose of this blog is to describe SAP NetWeaver AS, Code Inspector checks. Code Inspector is a tool used to perform static analysis of ABAP programs and other SAP repository objects. It is a framework where all the categories and checks are based on ABAP classes. SAP continuously delivers new built-in checks for new tools and new objects.

In this blog I will focus on 4 categories of checks.

  • Programming Convention Checks
  • S/4 HANA Readiness Checks
  • User Interface Checks
  • Performance Checks

Programming Convention Checks

This category contains:

ABAP naming convention checks which examine whether the naming conventions specified by the test parameters are met for the various objects (such as types, classes, or fields) defined in an ABAP program.

Extended check on naming conventions in ABAP programs examines whether the naming conventions specified by the test parameters are met for the various objects (such as types, classes, or fields) defined in an ABAP program.

Pretty Print State check in ABAP Programs establishes whether the ABAP code is formatted with respect to the configured Pretty Print variants.

ABAP unit test conventions check helps you to detect flaws in the code of Unit Tests. Unit Tests are special code fragments that execute the domain code in order to detect functional errors within the domain code. The test fragments – typically local classes – underlie some constraints. For example, they must not require interactive user input in order to ensure the capability of fully automated test execution.

Extended Check for ABAP Doc Comments are checked for completeness. In other words, the system checks if there is a comment for all the entities activated via the parameters.

S/4 HANA Readiness Checks

S/4 HANA Readiness Checks category contains checks for the conversion to SAP S/4HANA.

Field length extensions check searches – in the context of an SAP S/4HANA conversion – for statements where problems occur due to field length extension. This check is also able to check objects in a remote system.

Search for database operations is a check which searches – in the context of an SAP S/4HANA conversion – for database statements which are not permitted in the ABAP source code.

Search for usages of simplified objects is a check which searches – in the context of an SAP S/4HANA conversion – for usages of simplified objects (i.e. objects mentioned in the Simplification Database) within ABAP repository objects.

Search for ABAP Dictionary enhancements check searches – in the context of an SAP S/4HANA conversion – for customers’ ABAP Dictionary enhancements:

  • append structures
  • append views
  • customizing includes enhancing structures, database tables and database views mentioned in Simplification Database.
  • Suppressing messages on solved issues

Not all the above dependencies are being reported, however: if Simplification Database information states that the enhanced table or view has a proxy object and the proxy object should be accessed instead of the enhanced table or view, then the proxy object is validated.

The check message is suppressed if the proxy object can be used at runtime.

This check is also able to check objects in a remote system

Search for base tables of ABAP Dictionary views check searches – in the context of an SAP S/4HANA conversion – for simplified (i.e. mentioned in Simplification Database) database tables which are used as base tables in customers’ ABAP Dictionary views.The check analyzes classic ABAP Dictionary view types:

  • database view
  • projection view
  • maintenance view
  • help view

If a base table is found in the Simplification Database, further criteria apply to decide whether the finding is being reported, that includes:

  • view type
  • view maintenance status – access type read only or modify
  • simplification category of the base table

This check is also able to check objects in a remote system.

Search for S/4-related syntax errors check executes the Syntax-Check operation for a certain set of objects. An attempt is made to match the findings to SAP notes describing simplification items. We use a heuristic method to search for relevant SAP notes that might be related to the syntax error. That is why not all relevant notes or too many notes may be found.

User Interface Checks

This category contains:

Web Dynpro Component – Active Components check uses technology, such as Java, Adobe Flash, Microsoft Silverlight or others, to provide enriched functionality to the user.

Due to security constraints and the ongoing improvement of HTML, CSS and JavaScript, some of these technologies are no longer necessary or can be replaced by native functions. Additionally, browser vendors have started to block such plugin technologies.

This check identifies UI elements which are active components to provide an opportunity to analyze the usage of these elements. The rules of the check are:

  • Usage of Adobe Flash based component which requires a Adobe Flash plugin to be available in the Web browser of the user.
  • Usage of Adobe Forms based component which requires the Adobe Reader plugin to be available in the Web browser of the user.
  • Usage of Java applet based component which requires the installation of the JAVA runtime on the user machine. Additionally, a plugin is required in the Web browser of the user
  • Usage of Microsoft ActiveX based component which requires the usage of Microsoft Internet Explorer as Web browser.
  • Usage of Microsoft Office integration component which requires the installation of Microsoft Office and a Microsoft-based Web browser, e.g. Internet Explorer.
  • Usage of Microsoft Silverlight based component which requires the Microsoft Silverlight plugin to be available in the Web browser of the user.

Web Dynpro Component – Standard Check delegates the analysis of Web Dynpro Components to the technical check also used by the IDE. The IDs of findings are mapped generically by the priority used in the IDE. If you compare the information about the findings in the IDE and in the Code Inspector adapter, the IDE contains more information.

Web Dynpro Conventions for Source Text allows you to enhance the declaration of the user interface using code in certain places.

This Code Inspector test enables you to identify these problematic statements and avoid problems before they arise. These checks cover the following areas:

  • Database access
  • File access
  • Lists & Dynpro technology
  • Changes to the program flow
  • Low-level commands
  • Including source code
  • Direct method call
  • Querying the parameter interface

Dynpro Checks are checks on dynpros and resource consumption.

This check contains all usability and accessibility checks for dynpros and the scope of the check is identical to that in the menu function Check -Layout in Screen Painter (used for dynpro editing in the integrated SAP GUI).

‘SAP Script’ Scanner analyzes SAP Script content (SE61-documentation).

The following issues can be identified by the scanner:

  • Inconsistencies between transport key repository (TADIR) and document repository
  • Inactive document content
  • Inconsistent document content, like malformed tags
  • Invalid meta data, like missing master language

Performance Checks

This checks are detailed under the following links:

https://blogs.sap.com/2007/03/12/code-inspector-performance-checks-i

https://blogs.sap.com/2007/07/02/code-inspector-performance-checks-ii

https://blogs.sap.com/2009/01/21/code-inspector-performance-checks-iii

https://blogs.sap.com/2011/07/26/code-inspector-performance-checks-iiii

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Thomas Liebl

    Hello Peter,

    finally the “Pretty Print State check in ABAP Programs” arrived in SAP standard 🙂 Very good news.

     

    btw. I wrote some custom code inspector checks many years ago to extend the SAP checks with our (internal) development guidelines:

    1.) a.) Check the user settings for pretty printer in SE80 (CALL FUNCTION ‘RS_WORKBENCH_CUSTOMIZING’ – check for indent, style and lowercase settings of the current user who runs that check)

    1.) b) Check for Pretty Printer execution with the correct parameters/settings for the contained programs, function groups and global classes

    2.) Check all src for a change notice (legal requirement)

    3.) Check for a system internal documentation for Reports/Programs and global classes (also legal requirement)

    btw. I’m really happy that you released the Pretty Printer CI-class because the custom pretty printer check created problems with every major release upgrade (731->740->750) and had to be adjusted (FUNCTION PRETTY_PRINTER didn’t work correctly in lower releases).

    btw. I see the class CL_CI_TEST_PRETTY_PRINT delivered with SAPK-751BOINSAPBASIS and SAPK751HDC – so it is only available with 7.51+ should be backported to 740, too.

    Thank you again and best regards, Tom

    (0) 

Leave a Reply