Thursday, 12 December 2019

ABAP custom code adaptation for SAP HANA DB migration

Introduction


Objective of this blog is to provide a quick and short reference for custom code adaptation for SAP HANA database migration.

Scenario –  ERP system running on any DB to Business Suite on SAP HANA
Key Points to remember

◉ SAP HANA runs only on Unicode.
◉ SAP HANA database is available only for SAP systems based on SAP Netweaver Application Server ABAP or for SAP systems based on SAP Netweaver Application Server Java. It is not available for SAP NetWeaver dual-stack (ABAP+Java) systems such as SAP Process Integration.

SAP HANA Certifications, SAP HANA Learning, SAP HANA Tutorial and Materials, SAP HANA Guides

Once the prerequisite are completed, system is ready for the custom code adaption .There are 3 key aspects for custom ABAP code adaptation for SAP HANA.

Mandatory Corrections

◉ Avoid functional regression
◉ Code build on specific DB
     ◉ Eg. Native SQL

SQL performance optimizations

◉ Focus on frequently running SQL

Code pushdown

◉ CDS
◉ SQL Script


Recommended tools


For functional corrections

◉ Static code check tools – Code Inspector and the ABAP Test Cockpit.
◉ Variants Integrated in Code inspector (SCI).
◉ FUNCTIONAL_DB
◉ FUNCTIONAL_DB_ADDITION
◉ Implement Note 1935918 ( In case variant not found )
◉ Build unit tests and scenario tests for functional correctness
◉ Variant FUNCTIONAL_DB check for:
     ◉ Finding Native SQL
     ◉ Database (DB) hints
     ◉ Finding ADBC (ABAP Database Connectivity) Usages
     ◉ Finding usages of special DDIC function modules that check or return the existence or technical properties of certain DB indexes.
     ◉ Finding accesses to technical pools/clusters of a pool/cluster table
     ◉ Finding non-robust ABAP code that relies on non-ensured/implicit sorting of certain SQL queries, although no ORDER BY clause is used. There are two different checks available for finding non-robust ABAP code:
     ◉ “Search problematic statement…w/o ORDER BY”
     ◉ “Depooling/Declustering: Search for…w/o ORDER BY ”

For performance optimizations

◉ SQL Monitor (NetWeaver 7.40). (Tcode SQLM)
     ◉ Run in old productive system for ~ 2 weeks (at least)
     ◉ No system overhead.
◉ Sort the SQL Monitor results in transaction SQLM by “number of execution”
◉ Optimize the 10-20 Top most executed SQLs in your custom code using OPEN SQL,CDS, AMDP approach based on the scenarios.
◉ Additional performance hint
     ◉ Variants Integrated in Code inspector (SCI).
           ◉ PERFORMANCE_DB
◉ Don’t fix the static findings without looking in the SQL monitor before.
◉ Activate Usage Procedure Logging (UPL) in production system.(New name is SCMON).
     ◉ Before the migration starts
          ◉ Purpose : Limit work package
          ◉ T Code – /SDF/UPL_CONTROL
          ◉ Default number of days for which UPL data will be collected is 14( Max 99) days.
          ◉ Result is analyzed to identify productively used code
          ◉ Cleaning up of non-productively used code before the migration

Software Update Manager (SUM)

◉ Perform a release upgrade, install enhancement packages, apply Support Package Stacks, install add-ons, or updating single components on SAP NetWeaver

◉ Ensure that the entire data from the original database is copied to the HANA db

◉ Performs a row-count at the end of the DB migration.

◉ Compare the row-count from the tables in source DB with the row-count of the tables in the HANA DB.

◉ Create CRC (Cyclic redundancy checksums) , check that the content of the tables is still the same.

No comments:

Post a Comment