Blog - Understanding Evolution of CDS and AMDP in Most Simple Way (2019.05)
Blog - Understanding Evolution of CDS and AMDP in Most Simple Way (2019.05)
URL: https://blogs.sap.com/2019/05/19/understanding-evolution-of-cds-and-amdp-in-most-simple-
way/
After reading this blog reader would have a clear idea why SAP recommends CDS views, what is
AMDP and what are the benefits of CDS and AMDP over other methods.
As we all know HANA works on Push down techniques means, to make HANA DB do the
calculations which was earlier done by application layer in ECC.
1. Bottom-Up approach
2. Top-Down approach
1. Bottom-Up approach :
Here In Bottom-Up, we create views (Calculation view, Attribute view, Analytic view) at HANA DB
layer with HANA Modelling and these views are later exposed and used in ABAP layer via external
views.
External Views :
1. Read only
2. Monitored by ABAP dictionary
3. Can be used in ABAP programs to access data available in the form of Information Views in
SAP HANA DB.
4. More optimized than stored procedures. (discussed below)
Page 1 of 4
Summing up..
2. Top-Down approach :
In Top-Down, we create objects using ABAP code that can leverage power of SAP HANA. Here
comes CDS and AMDP into picture.
What are we doing in Top-Down?…We are creating models in application layer and it is going to
create same in DB layer. Its like, we are using door of application layer to create objects/models in
HANA DB.
1. Need additional license to create views in DB layer (For ABAP and HANA db both)
2. Dual maintenance
3. Synchronization of changes (If any change made in DB layer (models) it should be reflected
in App. layer)
4. Transport Management (need separate transports to move across ABAP and HANA db if
any changes made in both)
5. Additional license cost (maintaining both HANA and ABAP layer)
As we know now Top-Down has benefit over Bottom-Up. So, whatever we were achieving via
Bottom-Up we will be achieving same by Top-Down.
In Bottom-Up, we were creating views and later using them in our application layer by exposing them
i.e. creating external view. Now, in Top-Down, we achieve this via CDS. We create CDS views in
ABAP layer and as we activate or execute the same 2 views created.
1. ABAP View (at DDIC layer), also called DDL SQL view
2. HANA View (at HANA DB layer)
Other part was Procedures, we were writing procedures in Bottom-Up approach, directly in HANA
DB using native SQL query. Procedures are written if the business requirement is complex and
same can’t be achieved via information views.
For exposing Procedures, we can’t use external views so for that we were using stored procedure
proxy.
Bottom line :
Page 2 of 4
1. For views in Bottom-Up, replacement in Top-Down was CDS
2. For Procedures in Bottom-up, replacement in Top-Down is AMDP
CDS VS AMDP :
1. In AMDP, we can call one function inside the other, it is helpful in returning multiple result set
on complex logics. Whereas, CDS is dedicated for single set of logic and return only one
result set.
2. CDS views can be created to read and process data at DB layer. Whereas AMDP can be
created to process and modify data at DB layer.
3. AMDP is used to work with stored procedures, which further go to HANA DB layer and
execute that. This functionality can’t be achieved by Open SQL and CDS.
1. We are creating/using DB Procedures in AMDP and views in CDS without having access of
HANA DB layer.
2. AMDP and CDS can be created in eclipse only not in GUI as ADT (ABAP Development Tool)
plug-in is needed for this (also in HANA Studio).
3. CDS and AMDP does not need HANA license, when it is executed first time, it automatically
create views and procedures respectively in HANA DB. Next time it will take same from
HANA DB buffer.
4. Transferring data to other systems, CDS will create views and AMDP will create procedures
automatically in the new system.
Page 3 of 4
Note: CDS Views are compatible with any database whereas AMDP needs HANA as a
database and this is the reason CDS is more popular and is in demand.
Page 4 of 4