3. Optimizing your custom code
Before you start reading this blog it is good to read the blog series.
Once the performance identifications are prioritized, the code needs to be corrected as per the suggestions from the tools (ATC and SWLT). To improve the performance SAP suggests to code pushdown. Code pushdown is nothing but moving data intensive business logic to SAP HANA database layer by means of any HANA artefacts.
There are several optimization patterns available to improve the performance of the custom code. It depends on the use case as well as the Customer system's NW landscape. The image below is shows all the available SAP’s recommendations for optimizing the custom code.
Code pushdown is moving the data intense business logic as much as possible to data base layer by means of HANA artefacts or Advanced ABAP code pushdown concepts.
The above diagram depicts the code pushdown. When we talk about code pushdown there two approaches we suggest.
If the customer’s SAP NW SP is on 7.40 SP05 or above then this is the best suitable approach one should have. In Top down approach, there are three ways of code pushdown is possible.
If you choose top down approach, the code pushdown is possible via advanced open SQL, CDS views and ABAP Managed Database Procedures.
Example:
2. Advanced View Building (CDS): CDS simplifies and harmonizes the way you define and consume your data models, regardless of the consumption technology. Technically, it is an enhancement of SQL which provides you with a data definition language (DDL) for defining semantically rich database tables/views (CDS entities) and user-defined types in the database. The enhancements include:
CDS entities and their metadata are extensible and optimally integrated into the ABAP Data Dictionary and the ABAP language. CDS is supported natively in both the ABAP and the HANA Platforms! You can finally define and consume your data models in the same way (syntax, behavior, etc.) regardless of the SAP technology platform (ABAP or HANA).
Example:
3. ABAP Managed Database Procedures (AMDP): AMDPs enables you to create database procedures directly in ABAP using e.g. SQL Script and to seamlessly integrate it in modern ABAP development. An AMDP can be implemented using an ABAP method.
Example:
If customer’s SAP NW SP is below 7.40 SP05, the code pushdown is possible via creating HANA artefacts. There are four types of HANA artefacts can be created for code pushdown.
If you choose bottom up approach, there are four ways of code pushdown are available.
The image below explains the consumption part of HANA artefacts in ABAP layer.
ABAP consumption is possible by
SAP NW Release | Possible Code Pushdown Approaches |
---|---|
NW 7.40 SP05 or above |
|
Below NW 7.40 SP05 |
NOTE: External Views or Database Procedure Proxies can be created to consume the HANA artefacts in ABAP Code. |
Below NW 7.40 SPs [Ex: 7.31 SPs] |
NOTE: HANA artefacts can be consumed only via native SQL. |
There is a follow up blog which is explains a real time example of custom code optimization.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |