Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the...

- SAP Community

Community

SAP Community  Groups  Interest Groups  Application Development  Blog Posts

 Performance Guidelines for ABAP Development on the...

Application Development Blog Posts


Learn and share on deeper, cross technology development topics such as integration and connectivity,
automation, cloud extensibility, developing at scale, and security.

All community  What are you looking for today?

Performance Guidelines for ABAP Development on the SAP


HANA Database

Former Member


‎03-24-2013 4:46 PM

 51 Kudos

If you are an experienced ABAP Developer, then you most likely know the classical
performance guidelines for using Open SQL (if not, then you should look them up
immediately).

One of the frequently asked questions we receive is:

“What changes in the context of SAP HANA regarding these guidelines?”

Let us first reconsider the existing guidelines. In a nutshell, they are usually
summarized in the “5 golden rules”:

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 1/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

Icon Rule Details / Examples

Do not retrieve rows from the database and


discard them on the application server using
Keep the result CHECK or EXIT, e.g. in SELECT loops
sets small Make the WHERE clause as specific as
possible

Use SELECT with a field list instead of


SELECT * in order to transfer just the
Minimize amount columns you really need
of transferred data Use aggregate functions (COUNT, MIN, MAX,
SUM, AVG) instead of transferring all the
rows to the application server

Use JOINs and / or sub-queries instead of


nested SELECT loops
Minimize the
Use SELECT … FOR ALL ENTRIES instead of
number of data
lots of SELECTs or SELECT SINGLEs
transfers
Use array variants of INSERT, UPDATE,
MODIFY, and DELETE

Minimize the Define and use appropriate secondary


search overhead indexes

Avoid reading data redundantly


Use table buffering (if possible) and do not
Keep load away
bypass it
from the database
Sort Data in Your ABAP Programs

Well, the short answer regarding the question above is

All existing (standard and custom) ABAP code runs on SAP HANA without
modifications
All the existing guidelines are still valid for SAP HANA as general
recommendation

However, the priorities of some rules are changing, i.e. some aspects are less
important due to the nature of the In-Memory Column Store but there are also certain
patterns of non-optimal coding with higher impact on SAP HANA. Furthermore, there
https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 2/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

are completely new opportunities for performance tuning on SAP HANA which
were not possible in the past, e.g. by pushing complex operations to the database.

In this blog series, hermann.gahm and myself will drill into more details of the slightly
adapted performance recommendations, and give some background information. In
addition, we try to give some guidance for several frequently asked questions.

The planned structure of this blog series is as follows:

Performance Guidelines for ABAP Development on the SAP HANA Database


(this post)
Details and background information on adapted guidelines (to come)
Frequently Asked Questions for ABAP Development on SAP HANA (to come)

The following recommendations are derived from measurements and experiences


based on SAP Business Suite using SAP NetWeaver AS ABAP 7.4 running on SAP
HANA SPS5. They will be added to the standard ABAP 7.4 documentation and also
supported in standard tools such as the ABAP code inspector.
Guideline Additions in the context of SAP HANA

As on all database systems, there is a performance overhead


associated with every database access for connection handling, SQL
parsing, execution plan determination, etc.

The following existing guidelines should be prioritized higher on


SAP HANA:

For modifying operations (INSERT, UPDATE, DELETE) using


array operations should be preferred to single operations when
changing many data records
Nested SELECT loops should be avoided or replaced if possible
by

Changing the nested single SELECT statement to an


appropriate SQL construct (e.g. FOR ALL ENTRIES, JOIN,
sub-query, etc.)
Avoiding repeated access to the same data via SQL
Using the ABAP table buffer (see existing guidelines for the
ABAP table buffer)

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 3/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

Guideline Additions in the context of SAP HANA

In most cases, SAP HANA does not require secondary indices for
good search performance.

To reduce main memory consumption, and to improve insert


performance all existing non-unique secondary database indices on
columnar tables are removed during migration or do not get created
during installation for all AS ABAP systems from SAP NetWeaver 7.4
onwards.

For some use cases secondary indexes can still be beneficial. This is
especially true for highly selective queries on non-primary key fields.
These queries can be significantly improved by indexes on single
fields which are most selective. SAP Note 1794297 describes the
procedure to find and create these indexes.

The guideline is renamed to "Keep load away from the database,


but push data-intensive calculations to the database where
applicable"

On SAP HANA, it is beneficial to move data-intensive calculations into


the database. Nevertheless, it is not recommended to execute the
same operations redundantly, e.g. in different user contexts or
different dialog steps of the same user. Meaningful buffering of results
on the application server should be applied.

The following recommendation should be considered in this light on


SAP HANA

Sorting data:In general, the recommendations for sorting remain as


before, i.e. if the database does not use the same index for sorting as
for selection, then it may be in some situations more efficient to sort
in the application server in particular if all data to be sorted has to be
fetched from the application server anyway. However, if the sorting is
part of determining the result set (e.g. select top n customers by
revenue) or the sorting is part of a larger calculation logic (e.g. within
a procedure), it should be done in SAP HANA.

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 4/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

As outlined above, the next post contains some more technical background
information for the reasoning behind these recommendations, and some answers to
frequently asked questions.

SAP Managed Tags:

ABAP Development

Tags:

abap guidelines HANA Performance

14 Comments

PatrickVanOs
Explorer

‎03-25-2013 2:58 PM

 0 Kudos

Hi Eric,

According to note 1662726 the performance of a select statement with a FOR ALL
ENTRIES (FAE) clause could be poor. The note described to use a DB Hint.

However, one of the two prerequisites is that the select statement must not be a join
statement.

What do you recommend in case of a FAE in combination with a JOIN?

Is a database view the only option?

Regards,

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 5/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

Patrick

former_member192616
Active Contributor

‎03-31-2013 5:25 PM

 0 Kudos

Hi Patrick,

the note can be beneficial in some cases.

Regarding the FAE with the join there is no hint necessary / available. A join / view
(avoiding the FAE) can (but does not have to) be beneficial. I would recommend to
try different variants. It also depends on the version of HANA that you have in use
since FAE processing in HANA might be different.

Kind regards,

Hermann

abdul_hakim
Active Contributor

‎04-05-2013 12:34 PM

 0 Kudos

Nice blog. Looking forward to future blog series in this topic.

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 6/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

Thanks

Abdul Hakim

SuhaSaha
Advisor

‎04-26-2013 10:08 AM

 0 Kudos

Looking forward to the next blog in the series. A lil' bit of ABAP code won't harm
anyone 

BR,

Suhas

former_member192616
Active Contributor

‎05-18-2013 6:56 PM

 0 Kudos

Hi,

next posts will contain some ABAP.

Hope i will find some time to start them.


https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 7/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

Kind regards,

Hermann

Former Member


‎10-09-2013 1:53 PM

 0 Kudos

Hello Hermann

I have some basic questions on SAP HANA perfomance with ABAP.

If we migrate to a SAP HANA database on ECC, will our custom programs be more
performant even if we don't optimize them for HANA?

Same questions for the BW extractors and for some extraction programs generated by
the Informatica tool?

Globally, what can we expect in terms of performance increase on programs that are
not reviewed/optimized after migration to SAP HANA for ECC?

Thank you

Richard

former_member192616
Active Contributor

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 8/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community


‎10-09-2013 2:23 PM

 0 Kudos

Hi,

that depens on the SQL statements. Some will be faster, some will not change

and some might be slower.

Have a look at these documents for tools that can help you

in finding the SQLS that might need some adaptions.

http://scn.sap.com/docs/DOC-46714

http://scn.sap.com/docs/DOC-47444

Kind regards,

Hermann

Former Member


‎10-09-2013 3:03 PM

 0 Kudos

Thank you very much

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/ba-… 9/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

Former Member


‎11-06-2013 8:08 PM

 0 Kudos

Thank you very much, this is helpful

Peter_Inotai
Active Contributor

‎11-21-2013 10:04 AM

 0 Kudos

Hi Eric,

Very great summary!

Is there any change regarding fully buffered tables (eg customizing tables)?

Or everything stays the same (except that it's also in memory in DB side)?

Thanks,

Peter

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/b… 10/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

former_member192616
Active Contributor

‎11-25-2013 9:14 AM

 0 Kudos

Hi Peter,

regarding buffered tables there is no change for the golden rules. We continue to use
them like we did in the past. Local application server memory access (buffered table
in-memory of the local application server) is still faster than remote memory access of
the table in-memory of the databse server. With SAP Netweaver 7.4 there is a new
table buffer based on internal tables that allows to have secondary indexes in the
table buffer. With that we have even more buffering options.

Kind regards,

Hermann

Peter_Inotai
Active Contributor

‎11-25-2013 11:54 AM

 0 Kudos

Hi Hermann,

Thanks a lot for this clarification.

Peter

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/b… 11/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

justin_molenaur2
Contributor

‎02-26-2015 7:43 PM

 1 Kudo

I would second the recommendation to try to eliminate the FAE completely and use a
join instead.

I have a specific example at a customer where a cascading FAE was used as follows:

Select EKKO where columns in <ranges>.

Select EKPO FAE in it_EKKO.

Select EKET FAE in it_EKPO.

I imagine you'll find this technique all over the place. Anyhow, when running this
program normally on DB2, this specific section of code takes about 80 seconds (out of
a total of 100 seconds) runtime.

When I convert this to a join statement, not even a HANA view, just a simple join - I
get a total runtime of about 1.5s, so 52x+ faster.

SELECT X

FROM EKKO A

INNER JOIN EKPO B

INNER JOIN EKET C

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/b… 12/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

So I think the name of the game is finding these scenarios where you can make the
DB do the heavy lifting that it's meant to do.

Happy HANA,

Justin

Former Member


‎11-03-2015 3:00 PM

 0 Kudos

Hi Guys, any news about the next blog series?

Details and background information on adapted guidelines)

Frequently Asked Questions for ABAP Development on SAP HANA

Regards

 You must be a registered user to add a comment. If you've already registered,


sign in. Otherwise, register and sign in.

Comment

Labels In This Area


A Dynamic Memory Allocation Tool 1 ABAP 8 abap cds 1 ABAP CDS Views 14

ABAP class 1 ABAP Cloud 1 ABAP Development 4 ABAP in Eclipse 1

ABAP Keyword Documentation 2 ABAP OOABAP 2 ABAP Programming 1

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/b… 13/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

abap technical 1 ABAP test cockpit 7 ABAP test cokpit 1 ADT 1

Advanced Event Mesh 1 AEM 1 AI 1 API and Integration 1 APIs 8

APIs ABAP 1 App Dev and Integration 1 Application Development 2

application job 1 archivelinks 1 Automation 4 BTP 1 CAP 1 CAPM 1

Career Development 3 CL_GUI_FRONTEND_SERVICES 1 CL_SALV_TABLE 1

Cloud Extensibility 8 Cloud Native 7 Cloud Platform Integration 1

CloudEvents 2 CMIS 1 Connection 1 container 1 Debugging 2

Developer extensibility 1 Developing at Scale 4 DMS 1 dynamic logpoints 1

Eclipse ADT ABAP Development Tools 1 EDA 1 Event Mesh 1 Expert 1

Field Symbols in ABAP 1 Fiori 1 Fiori App Extension 1 Forms & Templates 1

IBM watsonx 1 Integration & Connectivity 10 JavaScripts used by Adobe Forms 1

joule 1 NodeJS 1 ODATA 3 OOABAP 3 Outbound queue 1

Product Updates 1 Programming Models 13

Restful webservices Using POST MAN 1 RFC 1 RFFOEDI1 1 SAP BAS 1

SAP BTP 1 SAP Build 1 SAP Build apps 1 SAP Build CodeJam 1

SAP CodeTalk 1 SAP Odata 1 SAP UI5 1 SAP UI5 Custom Library 1

SAPEnhancements 1 SapMachine 1 security 3 text editor 1 Tools 16

User Experience 5

Popular Blog Posts

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/b… 14/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

Get Started with the ABAP Development Tools for SAP NetWeaver

OlgaDolinskaja
Product and Topic Expert

 172476  12  1440

Become an ABAP in Eclipse Feature Explorer and earn the Explorer Badge

ThFiedler
Product and Topic Expert

 24644  147  366

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/b… 15/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

Six kinds of debugging tips to find the source code where the message is raised

JerryWang
Advisor

 208311  56  320

Top Kudoed Authors

BaerbelWinkler  5

qmacro  5

Juwin  3

matt  3

horst_keller  2

former_member204528  2

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/b… 16/17
4/22/24, 3:22 PM Performance Guidelines for ABAP Development on the... - SAP Community

adityaw  2

https://community.sap.com/t5/application-development-blog-posts/performance-guidelines-for-abap-development-on-the-sap-hana-database/b… 17/17

You might also like