ABAP and SAP HANA
AS ABAP can access the SAP HANA database of a standalone SAP HANA appliance (combined hardware and software system) using a secondary database connection and, for example, ADBC. Various tools and accelerators are available for replicating data from the database of an AS ABAP to the SAP HANA database, to enable high-performance analyses.
Furthermore, an SAP HANA database can be implemented as the central database of an AS ABAP. In this case, the AS ABAP database tables managed by ABAP Dictionary are saved in the database schema SAPsid. sid stands for the system ID (name of the AS ABAP). As usual, database tables of this type can be accessed using Open SQL or Native SQL (ADBC). With respect to ABAP programs, SAP HANA databases behave in this case in the same way as a regular relational database. All HANA-specific functions are wrapped by the database interface and access is optimized to the greatest extent possible.
To exploit the in-memory properties of the SAP HANA database in an optimum way, however, application logic must be transferred in a suitable form from the application server to the SAP HANA database. This can be done, for example, using suitably programmed joins, but these Open SQL-methods are often not enough. Instead, parts of the application logic must itself be programmed in SAP HANA Studio on the SAP HANA database. The following methods are available, with the most complex listed first:
- Attribute views - Selected columns of joins between tables. Attribute views are created in a graphical tool and transformed internally to SQL.
- Analytic views - A combination of table data and aggregated data from one or more tables. Analytic views are created in a graphical tool and transformed internally to SQL.
- Calculation views - A combination of table data or data from other views in which complex conditions and calculations are possible. Calculation views are either created in a graphical tool and transformed internally to SQLScript or can be programmed using SQLScript.
- in SAP HANA Studio
- as ABAP Managed Database Procedures in special methods of ABAP classes
- Programming of dedicated database procedures in L. This programming is only allowed internally at SAP and not for customers and partners.
The following sections demonstrate HANA-specific methods of accessing entities in the SAP HANA database from ABAP programs:
7.31 | 7.40 | 7.54
- SAP HANA views cannot be created using Native SQL, since the description language is XML-based, not SQL-based.
- Instead of calling SQLScript procedures using database procedure proxies, ABAP Managed Database Procedures (AMDP) are recommended. AMDP can be used to create and manage new database procedures. Existing database procedures can be called from AMDP. Database procedure proxies are required only if a secondary database connection is used to access an SAP HANA database that is not the central database of the current AS ABAP (side-by-side scenario). For AMDP, only secondary database connections to the central database of the current AS ABAP can be used.