Skip to Content

ABAP for HANA: how to accelerate existing ABAP applications by leveraging power of HANA

Just after returning from SAP Teched held at Bangalore recently, with packed back to back sessions and demo pod areas on HANA (specifically in the area of ABAP for HANA), the learning has been awesome. It promises another exciting year ahead. We already have good blogs in this area, but I tried to put in my understanding about how SAP HANA can be leveraged to accelerate existing ABAP applications in ERP.

In this blog, I have tried to summarize different approaches that can be followed to make existing ABAP applications accelerate by leveraging the optimization techniques through SAP HANA.

  1. First do a Root cause analysis to check why the reports are running slow (do a Trace ST05). If the runtime takes place mostly on the database level then HANA could be beneficial to your performance without changing much in the code.
  2. If the majority of the runtime takes place on the application server (e.g. processing of internal tables) then you may need to think about rewriting the report if you want to make use of HANA. With HANA you can let the database do the heavy calculations, aggregations, etc. This can be done easily by using HANA as secondary database.

For both the above approaches, we could use a side-by-side car approach where in HANA is used as a secondary database, data is replicated from ERP to HANA through SAP LT replication server as shown below. 

HANA as secdb.JPG

  1. If you have a more complicated application which you want to optimize for SAP HANA (or maybe you want to develop a completely new application based on ABAP/SAP HANA and you cannot wait for ERP on SAP HANA to be available or you don’t want to migrate your SAP ERP system to SAP HANA at all), then we could consider AS ABAP 7.4, which is optimized to leverage in-memory computing features of HANA. Sample scenario would look like this.


A beta shipment for this is planned for end 2012. Ramp-Up is planned for 2013. Lets try not to include features of AS ABAP 7.4 in this blog as the focus is here on current General Available HANA system(AS ABAP 7.x)

Some of the techniques that we could use to accelerate our existing ABAP applications are as follows.

  1. 1. Business Application accelerator:   a SAP HANA database together with an instrumented application server.  A well defined set of tables is replicated continuously to the SAP HANA database. The instrumented application server is able to run the ERP applications without modifications. It executes read and write operations on the main database. Only for certain scenarios it reads data from replicated tables on the SAP HANA database via a secondary database connection and not from the main database: Instrumented Application server is as shown below :

            Instr App Server.JPG

Scenarios are specified by defining the context in which data is to be read from the SAP HANA database.

Context Definition – This can be done at Tables / DB Views , or Main program or Batch job name level. This can be done by creating an entry in RDA_CONFIG table. This table can also be maintained by RDA_MAINTAIN report that uses a scenario (Scenarios are specified by defining the context in which data is to be read from the SAP HANA database. – this is in the form of an .xml file ) with a table name and program name, use the “Upload scenario” option. This is an easy mechanism to enable the application to read data from HANA database instead of the classical database.

Once an entry is created in the above table, the “Connection Decider” decides to read data either from secondary database (HANA database here) or from the Primary database as shown below.

Conn decider.JPG

Instrumented application server needs the following steps to be done

  • SAP Business Application Accelerator Add On package needs to be installed (SAP Note 1713986 and 1716826) , Also complete details of this should be available in SAP note 1694697
  • Upgrade SAP Kernel of AS to 7.2.1 (SAP Note 1713986 and 1716826)
  • Activation of SAP Business Application Accelerator need to be done by enabling the profile parameter as rsdb/rda = on in transaction RZ11.
  • Data needs to be replication from SAP Business suite system to HANA environment – SLT is the replication mechanism suggested by SAP here. Take care, that all tables / views that are part of the scenario are created on the SAP HANA database and start the replication for those tables.
  • Setup Secondary Database Connection – Need to do the same in table for table DBCON, by providing the DBMS type (HDB for HANA), the user name and password you want to use for all connections and the connection string. This is explained in detail in Thomas Jung’s blog HANA Connectivity via Secondary database connection .
  • Set secondary database connection for the scenario – Use report RDA_MAINTAIN to set the secondary database connection for the scenario. Select “Maintain Database Connection”, specify the scenario name, the name of the secondary database connection from previous step.
  • Activate scenario by the RDA_MAINTAIN report.

  2. ADBC (ABAP Database Connectivity) – ADBC is an API for the Native SQL interface of the AS ABAP that is based on ABAP Objects. With ADBC, we can do the following:   

  • Access to entire SQL functionality of underlying DB system
  • Dynamic creation and execution of native SQL statements via respective API methods
  • Clean concept for multiple DB connections (connections are associated to connection objects)
  • Exception handling – API methods have well-defined exceptions that can be handled
  • Native SQL can be used via EXEC SQL (and related) statements or the ABAP Objects based ADBC (ABAP Database Connectivity) API.

Class CL_SQL_CONNECTION offers methods like Create, update, insert etc to work with the underlying database.  It is suggested to use ADBC as it works faster than the open SQL.

3. Code Pushdown – Calculation logic in applications can be pushed down from the Application server to the Database server. This can be done easily through SQL script (procedural extension of SQL). SQL script procedures may contain SQL statements and call other procedures. It is used to write procedural orchestration logic and to define complex data flows. . The SQL script procedure can be created easily as shown below:

Str prc.JPG

Stored procedures can be created in SQL script editor of HANA studio or can be created in ABAP program. Same can be consumed through ADBC and has been proved that SAP script procedures works faster that simple open SQL statements.

Some of the blogs on SCN that can help to accelerate SAP ECC Applications.

Accelerating SAP ECC Applications – Part 1

Accelerating SAP ECC Applications – Part 2

What is the future of ABAPer ? Is there anything new coming up?  has been one of  the major questions lingering in most of the ABAPer’s minds ,  I could find that the answer indeed was Adapt to the changing SAP scenarios, improve your zest to learn new Technologies Learn the required skill sets for the same – ABAP for HANA, SQL scripts etc, experiment the learning and move on …

You must be Logged on to comment or reply to a post.
  • Hi Suma,

    very nice blog! Thanks a lot for writing it. I like to add two thoughts:

    Another option besides the business application accelerator and Native SQL / ADBC is to use Open SQL to access a secondary SAP HANA database (by means of the 'CONNECTION' addition in SELECT). This works for replicated tables. It does not work for SAP HANA views / database procedures.

    Regarding "...has been proved that SAP script procedures works faster that simple open SQL statements": I personally don't expect to see a significant difference, if you look at exactly the same SQL statement. I would rather say that you can (potentially) accelerate an algorithm consisting of Open SQL and ABAP procedural logic by an identical algorithm in a procedure.

    Best regards


  • Hi,

    Can ABAP on HANA be used to optimize even OLTP transactions like VA01 (transactions that perform insert/updates/deletion in application tables). And how do we specify to the system which transactions have to be optimized.

    Kindly advise.

  • Absolutely helpful blog. Thanks Suma for sharing great insights.

    I have a quick question, is it possible to improve the performance for the standard SAP transactions same way as described in this blog? For example, finance settlement transactions say KO8G is running slow and say we create the secondary DB connection then how do we use it to improve the performance for the standard SAP transactions?

    • Hi Sohil,

      Yes, it is possible to accelerate standard transactions.

      Use the transaction: HDBC (this transaction is visible only when your ABAP system has non-HANA DB as primary DB)

      In this transaction HDBC, you can only redirect the higher application level, (for ex all the transactions of MM, IM, Finance and so on). You can give the secondary DB connection to the higher application level so that all the transactions will be redirected to the secondary HANA DB. Fine granular(individual transaction level) configuration is not possible. It also does not make sense to split the transactions to different DBs as the used tables will be overlapping in different transactions

      Hope this helps



      • Thanks Paneer Selvam. This is indeed helpful. Much appreciated !

        So for the typical T-code acceleration (one of the different methods), please correct if I am wrong for the listed steps:

        1. Install Business Application Accelerator add on to ECC system.

        2. Request the scenarios from SAP. (SAP Note - 1694697) -- Is this correct?

        3. Create HANA as secondary DB.

        4. Configure SLT with required table replication to HANA DB

        5. Using HDBC transaction, set up the std module acceleration. Or

        6. For custom programs / transaction write the necessary ABAP programs.


        Sohil Shah.