Skip to main content

Development Guidelines ABAP on HANA

ABAP on SAP HANA: Building business application optimized for In-memory.
To leverage the strengths of SAP HANA from a development perspective, applications follow the “code to data” or so called “code-push-down” paradigm in which data intense computations and calculations logic is pushed down from the application server to the database server.

Example for a simple report: 

In general all code that uses OPEN SQL will benefit already automatically. Therefore it’s also strongly recommended to apply high coding standards/ development guidelines, like the “5 Golden SQL rules” provided by SAP or new OPEN SQL features. However it could be that more performance improvement is required by the business. HANA specific optimization techniques like AMDP (ABAP Managed Database Procedure) or CDS (Core Data Services) views might be required to implement.

5 Golden SQL rules

The next “5 Golden SQL rules” are applicable for development on any DB. However some rules will have more impact on HANA than others.
1. Keep the result sets small
You should aim to keep the result set small. This reduces both the amount of memory used in the database system and the network load when transferring data to the application server. To reduce the size of your result sets, use the WHERE and HAVING clauses.


2. Minimize the amount of transferred data
Data is transferred between the database system and the application server in blocks. To minimize the network load, you should transfer as few blocks as possible. Open SQL allows you to do this as follows:

  • Restrict the Number of Lines

  1. If you only want to read a certain number of lines in a SELECT statement, use the UP TO          <n> ROWS addition in the FROM clause.
  2. If you expect the WHERE clause to return a large number of duplicates entries, you can use      the DISTINCT addition in the SELECT clause.

  • Restrict the Number of Columns

  1. Do not use * to select all columns unless you really need them. You should only read the columns from a database table that you actually need in the program.

  • Use Aggregate Functions

  1. If you only want to use data for calculations, it is often more efficient to use the aggregate functions of the SELECT clause than to read the individual entries from the database and perform the calculations in the ABAP program.

  • Data Transfer when Changing Table Lines

  1. When you use the UPDATE statement to change lines in the table, you should use the WHERE clause to specify the relevant lines and then SET statements to change only the required columns.

3. Minimize the number of data transfers

In every Open SQL statement, data is transferred between the application server and the database system. Furthermore, the database system has to construct or reopen the appropriate administration data for each database access. You can therefore minimize the load on the network and the database system by minimizing the number of times you access the database.

  • Multiple Operations Instead of Single Operations


  1. When you change data using INSERT, UPDATE, and DELETE, use internal tables instead of single entries.

  • Avoid Repeated Access

  1. Avoid accessing the same data more than once (for example, SELECT before an UPDATE).

  • Avoid Nested SELECT Loops

  1. A simple SELECT loop is a single database access whose result is passed to the ABAP program line by line. Nested SELECT loops mean that the number of accesses in the inner loop is multiplied by the number of accesses in the outer loop. You should therefore only use nested SELECT loops if the selection in the outer loop contains very few lines.





4. Minimize the search overhead
To minimize the size of the result set use the WHERE and HAVING clauses. To increase the efficiency of these clauses, formulate them to fit with the database table indexes.
In case of highly selective queries on non-primary key fields, a secondary index could be beneficial. Some key points to keep in mind:
  • Create the index on a large table if access is still slow.
  • Create inverted indexes on the most selective columns.
  • Create composite indexes on the most selective column combinations
  • Indexes have maintenance costs, especially composite indexes. Avoid this as much as possible.

5. Keep load away from the database
Unlike application servers and presentation servers, there is normally only one database server per SAP instance and applications should be written to reduce the database load as much as possible.
Buffers:
  • Cross-user buffers: Shared objects, shared buffer, shared memory table buffer.
  • User-specific buffers: SAP memory, ABAP memory, program-specific buffering in internal tables.

Comments

Popular posts from this blog

new syllabus 6 th science &social science term 3 text book Tamil medium

Term 3 New sylabus text book released today .New textbooks for Tamil Nadu state board students: Upgraded visual representations, internet activities page having website/mobile links and QR codes that can help students directly access info about topics are some of the features of the new textbooks. A total of 177 titles have been printed covering these four grades (1, 6, 9 and 11) under each subject. Besides increasing the quality of paper of these books, some innovative measures like ICT corner for lessons are part of the new texts. 6 th std term 3 Science &social science Tamil medium The entire year’s content for Class XI has been published as one textbook. However, textbooks for Classes I, VI and IX are printed in three volumes following the trimester system of quarterly, half yearly and annual semesters. Books for Class XI include a lot more titles compared to those for lower classes due to the different groups like commerce, biology and computer science. There are around 50 co...

Why to choose SAP HANA

SAP HANA is a next-generation in-memory business platform. It accelerates analytics and application on a single and in-memory platform. Mentioned below are the few reasons why to choose SAP HANA – Real Time – SAP HANA Provides Real-Time Data Provisioning and Real time Reporting. Speed – SAP HANA provide high speeds processing on massive data due to In-Memory Technology. Any Data/Source - SAP HANA can access various data source including Structured and Unstructured data from SAP or Non-SAP data source. Cloud - SAP HANA database and application can be deployed to the Cloud environment. Simplicity – SAP HANA reduce efforts behind ETL process, Data Aggregation, Indexing, and Mapping. Cost – SAP claims that SAP HANA Software can reduce Total IT cost of a company. Choice Option – SAP HANA is supported by different hardware vendor and Software provider, so based on the requirement, the user can choose the best option.