ABAP Code Inspector Check Variants for HANA Migration Optimization
SAP developers use ABAP Code Inspector for HANA migration to optimize ABAP codes to prevent and correct performance problems. Before migrating your SAP system to a SAP HANA platform, ABAP developers can follow best practises for code optimization published by SAP. ABAP Code Inspector will help a lot to detect the code statements in custom ABAP codes that might cause performance problems after HANA migration.
In this ABAP tutorial, I want to show ABAP developers how ABAP Code Inspector can be used by creating a sample check variant, how to transport check variants to other systems and SAP reference documents and SAP OSS note which provides predefined check variant for detecting problematic code statements.
Developers can execute SAP transaction SCI to run ABAP Code Inspector report.
Call SAP SCI tcode, initial screen will be displayed.
Provide a Check Variant which controls and lists issues related with SAP HANA migration
Here is a list of selection items for the SAP HANA Migration critical check variant are as follows.
Performance Checks:
Analysis of WHERE Condition for SELECT
Analysis of WHERE Condition in UPDATE and DELETE
SELECT Statements That Bypass the Table Buffer
Search problematic SELECT * statements
Low Performance Operations on Internal Tables
Low-Perform. Parameter Transfers
Table Attributes Check
Instance Creation of BAdIs
Security Checks
Critical Statements
Use of ADBC Interface
Syntax Check/Generation
Extended Program Check (SLIN)
Robust Programming
Search DB Operations in Pool/Cluster Tables
Search problematic statements for result of SELECT/OPEN CURSOR without ORDER BY
Unsecure use of FOR ALL ENTRIES
User Interfaces
GUI Usability Check
Web Dynpro Component - Standard Check
Web Dynpro Programming Conventions
Screen Check for Usability und Accessibility
Analyse 'SAP Script' documents
Search Functs.
Search ABAP Statement Patterns
Intern. Tests
Depooling/Declustering: Search SELECT for Pool/Cluster-Tables w/o ORDER BY
SAP OSS Note 1935918 provides the Code Inspector check variants for HANA Migration named FUNCTIONAL_DB and FUNCTIONAL_DB_ADDITION.
So before migrating to SAP HANA, you can optimize your custom code for HANA in order to get a better performance using these two check variants prepared by SAP for customers.
When ABAP developers select these check variants on SCI transaction and execute Code Inspector, it will display a list of results which developers should take care before migrating to SAP HANA.
If the code inspection was not carried out before first create a new inspection and execute it for the results.
The return list displays the object name, object type (CLAS, PROG, FUGR), package, check description, message text and line of the code filtered by the code instector SCI. Also responsible person column helps developers to define the related developer for correction.
If you double click on an item in the result, the ABAP developer will be redirected to the place in code where the correction should be done in ABAP Editor.
Most common problems to be corrected for SAP HANA readyness are as follows:
Search problematic SELECT * statements
Depooling/Declustering: Search SELECT for Pool/Cluster-Table
Search problematic statements for result of SELECT/OPEN CURS
Check Description: Search problematic SELECT * statements
Message Text can vary:
Existence check. No fields used
Select-Statement can be transformed. 4.9% of fields used
Incomplete evaluation. 2.0% of fields used
Please read article Select-Statement can be Transformed for optimizing select statement field list for post HANA migration performance.
Check Description: Depooling/Declustering: Search SELECT for Pool/Cluster-Table
Message Text can vary:
SELECT ... FOR cluster table KONV without ORDER BY found
Please read article Select For Cluster Table Without Order By for correcting this kind of problematic Select statement usage for HANA migration optimization.
Check Description: Search problematic statements for result of SELECT/OPEN CURS
Message Text can vary:
LOOP AT itab. EXIT/RETURN/LEAVE ... for result of statement at Include LSVIMFXL line 1461
For optimizing your custom ABAP code in your SAP systems before migrating to SAP HANA, please check following resources and guides:
Best Practices for Transitioning Custom ABAP Code to SAP HANA
Tune Your Custom ABAP Code
ABAP on HANA - from analysis to optimization
How to Create Code Inspector Check Variant and Transport in a Workbench Request
In order to create a check variant to transport to other SAP systems, the ABAP developer should create the check variant as Global instead of Local, and mark it as Transportable on SCI Code Inspector transaction screen.
Execute SCI tcode
Type the Check Variant name
Make sure you selected Global icon marked with red rectangle
Press Create icon to continue.
When you passed the initial code inspector screen and reach to second one, mark the Transportable checkbox.
Then select the items listed below that you want the Code Inspector to analyze and perform inspection
On above a global transportable code inspector check variant can be seen. It is Global and Transportable checkbox is selected.
When the check variant is saved, an ABAP Object Directory entry will be created. Select a suitable package for the ABAP program which starts with the check variant name and end with "======VC"
Then you will be prompted to select a transportable Workbench request or will be able to create a new one for the code inspector check variant distribution.