ABAP has been rapidly evolving over the years. With introduction of S/4HANA it went to graduate to become a far more impressive and productive language. If you ask me how ABAP has improved then the answer is “Code-To-Data” Paradigm.
The traditional approach involves bringing data from database to our presentation server, doing the data intensive calculations & filtering and then presenting the filtered data to user.
The new HANA approach is to push our code to the database layer where all the data resides, do the calculations at database layer and bring only the relevant records to presentation server.
To better understand this let me proceed using a basic scenario that any ABAP developer can easily relate to:
Example Scenario: An ALV report that returns the master data of “ALL” vendors and their addresses for vendors that are active, not marked for central deletion, not marked for deletion under “ALL” company code, not marked for deletion under “ALL” purchasing organization.
In this scenario, the performance would suffer because of fetching data for all vendors, for all company codes & for all Purchasing Organization. The resulting report will require a background run and the traditional ABAP report flow in this case would fetch data.
- Core Data Services (CDS) Views
SAP introduced a new data modeling infrastructure known as core data services or CDS. With CDS, data models are defined and consumed on database server rather than on application server. As a result, the table result view is created at the database level. CDS are completely compatible with open SQL and can be written using ABAP development tools like Eclipse Oxygen. These can be consumed by reports and AMDPs as well.
ABAP Managed Database Procedures (AMDP)
AMDPs as the name says are database procedures that run on database directly and are written directly in ABAP. AMDPs are written using AMDP classes. Below is an example using the above scenario of how to create an AMDP class. The interface “IF_AMDP_MARKER_HDB” distinguishes an AMDP class from other classes.