Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation Log On Join Us Hi, Guest Search the Community Activity Communications Actions Browse ABAP for SAP HANA Previous post Next post 0 Tweet 2 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.
3. 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. ABAP for HANA: how to accelerate existing ABAP applications by leveraging power of HANA Posted by Suma Rammohan in ABAP for SAP HANA on Dec 11, 2012 6:47:33 AM Share 3 1 Like 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 :
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. 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 Average User Rating (6 ratings) 0 Tweet 2 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 Jungs 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:
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 ABAPers 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
5294 Views Tags: abapforhana, abap_for_hana Share 3 1 Like Follow SCN Site Index Contact Us SAP Help Portal Privacy Terms of Use Legal Disclosure Copyright 4 Comments Like (0) Thorsten Schneider Dec 11, 2012 3:29 PM 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 Thorsten Like (0) Suma Rammohan Dec 13, 2012 6:57 AM (in response to Thorsten Schneider) Thanks Thorsten..
Will note to use Open SQL to access secondary SAP HANA database.
Regards, Suma Like (0) Rama Shankar Jun 18, 2013 8:37 PM Hi Suma, Nice blog - thanks! Like (0) Saurabh Diwakar Apr 8, 2014 9:56 AM 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.