By now, we all have pretty good clarity that CDS Views, AMDP and Open SQL are not competitors to each other. They all help us to achieve the ‘Code to Data’ Paradigm shift. They are different tools for the same team and they all can co-exist.
Yes, all these are used for fetching data from Database. But we have to use the appropriate tool based on the requirements. Remember, if a needle (read SQL) can do your job then why worry about a sword (read CDS / AMDP). Similarly, if the job can be done ONLY by the needle then you cannot achieve the same result using the sword. After all, “Discretion is the better part of valor“. 🙂
Below is some basic guideline to determine the most appropriate “Code to Data” Technique.
CDS Views
i) Only ONE result set can be returned from a CDS View
ii) CDS views amount to least amount of coding with the ability to be reused in multiple objects across developments. In another word, it’s a database artifact that can be consumed across objects/applications
iii) It uses IDA class of SAP GUI hence much faster (kind of paging technique )
Interdependent SQL queries which will be used across applications (programs/object) are the best example for choosing CDS Views
AMDP
i) Independent SQL Statement those are not often used in other objects
ii) MULTIPLE result sets are needed
iii) Powerful features of native SQL such as currency conversion and CE functions can be leveraged.
Open SQL
i) If the SQL queries are for the specific object and won’t be needed elsewhere (not reusable)
We cannot create an official guide to determine the Order of Preference for Code Push down. 🙂 But, practically they can have the below order:
1) Open SQL or CDS views
2) AMDP
What about the order of preference between Open SQL Vs. CDS?
When it comes to reusability, large feature set and domain-specific consumption of data models, then we should go for ABAP CDS. If CDS Views and SQL can achieve the same functionality, then go ahead with the CDS View (which is already there in the system).
If a CDS does not exist and you need this SQL only in one program, do not take the hassle of creating a CDS which would never be used again in another application. Just go ahead and write your Open SQL.
Please note: Both Open SQL and CDS are OPEN to any underlying database i.e. they are Platform Independent. And therefore they are the first choice.
Also Read: Are Native SQL and Open SQL Competitors?
If you still doubt our above justification and explanation, then the below Flow Chart from SAP would help you make the better judgment with confidence. 😛
Before we close, as mentioned in our earlier article New Age Open SQL ABAP 740, at the end of the day, whichever one works best for your project, team and application, use it. The end user would not see any difference in usability and result. It is all about maintenance and knowledge of your technical team members.
If you want to get such useful articles directly to your inbox, please SUBSCRIBE. We respect your privacy and take protecting it seriously.
If you liked this post, please hit the share buttons and like us on facebook.
Do you have anything to add to this article? Have you faced any issue using Open SQL, CDS View or AMDP? Do you want to share any real project requirement or solutions? Please do not hold back. Please leave your thoughts in the comment section.
Thank you very much for your time!!
Check HANA-ABAP Tutorials
- ABAP on SAP HANA. Part I. First Program in ABAP HANA
- ABAP on SAP HANA. Part II. ADT Eclipse and HANA Studio
- ABAP on SAP HANA. Part III. Debugging in ADT
- CDS Part 1. Core Data Services – Introduction
- CDS Part 2. Core Data Services – Deep Dive
- ABAP on SAP HANA. Part VI. New Age Open SQL ABAP 740
- ABAP on SAP HANA. Part VII. SQL Script and SAP HANA Stored Procedure
- ABAP on SAP HANA. Part VIII. ADBC – ABAP DataBase Connectivity
- ABAP on SAP HANA. Part IX. AMDP – ABAP Managed Database Procedure
- ABAP on SAP HANA. Part X. AMDP with SELECT OPTIONS
- ABAP on SAP HANA. Part XI. Are Native SQL and Open SQL Competitors?
- ABAP on SAP HANA. Part XII. Open SQL, CDS or AMDP, which Code to Data Technique to use?
- ABAP on SAP HANA. Part XIII. Sample Functional Specification of HANA Project
- ABAP on SAP HANA: Part XIV. HANA Ready, HANA-tization & HANA Plus
- CDS Part 3. Expose CDS Views as OData Service through Annotation
- ABAP on SAP HANA: Part XVI. HANAtization
- ABAP on SAP HANA: Part XVII. ATC – ABAP Test Cockpit Setup & Exemption Process
- SAP ABAP on HANA: Part XVIII. SALV IDA (Integrated Data Access)
- ABAP for SAP HANA. Part XIX. Sample Technical Specification of HANA Project
- ABAP for SAP HANA. Part XX. ALV Report On SAP HANA – Opportunities And Challenges
- 4 Useful Tips on ABAP and ABAP on HANA
- Associations in HANA – A Conceptual Approach
- CDS Part 5. ABAP CDS Views With Authorization
- ABAP for SAP HANA. Part XXII. How to Consume Native HANA Views Using ADBC?
- CDS Part 6. Basic Expressions & Operations Available for CDS View – I
- 115 ABAP for SAP HANA Interview Questions & Answers
- CDS Part 7. Basic Expressions & Operations Available for CDS View – II
- CDS Part 8. Usage of Built-In Functions in CDS – I
- CDS Part 9. Usage of Built-In Functions in CDS – II
- CDS Part 10. Usage of Built-In Functions in CDS – III
Step by Step Tutorials on SAP Netweaver Gateway and OData
- OData and SAP Netweaver Gateway. Part I. Introduction
- OData and SAP Netweaver Gateway. Part II. Create your first OData Service
- OData and SAP Netweaver Gateway. Part III. Query Options in OData Service URI
- OData and SAP Netweaver Gateway. Part IV. Association and Navigation in OData Service
- OData and SAP Netweaver Gateway. Part V. CRUD Operations in OData Services
- OData and SAP Netweaver Gateway. Part VI. Frequently Asked Questions
- OData and SAP Netweaver Gateway. Part VII. Debugging, Trace, Cache Cleanup and F4 Help
- OData and SAP Netweaver Gateway. Part VIII. SAP’s Love for OData – a Tale of the Friendly ABAPer
- CDS Part 3. Expose CDS Views as OData Service through Annotation
- OData and SAP Netweaver Gateway. Part IX. How to Add Multiple Entities in One Operation in OData Service
- OData and SAP Netweaver Gateway. Part X. How to Delete OData Service from Service Catalog?
- OData and SAP Netweaver Gateway. Part XI. Query Options & HTTP Status Code Summary
- SAP Netweaver Gateway and OData. Part XII. Media Handling using OData Gateways
- SAP Netweaver Gateway and OData. Part XIII. Entity Tags in SAP OData Gateways
- SAP Netweaver Gateway and OData. Part XIV. OData Service using RFC
- Free Video Course – Introduction to SAP Netweaver Gateway & OData
- SAPUI5 for ABAPers – Consuming OData Service from SAPUI5 Application – CRUD Operations
- Advance SAPUI5 – 2- Push Notification in SAP – ABAP Push Channel, ABAP Messaging Channel in SAPUI5 – a Real Time Interaction
- CDS Part 11. How to Consume CDS View in Smart Business Service KPI Fiori Apps?
- XSOData and Hana Database Views for Beginners
- OData Service from CDS Annotation Not Working in Browser Mode
- SAPUI5 – Custom Control in UI5
- Using Postman to “POST” without modifying ~CHECK_CSRF_TOKEN in ICF settings.
- ABAP Programming Model for SAP Fiori – 4 – OData Service Creation
- ABAP Programming Model for SAP Fiori – 5 – OData Service Generation
- CDS Part 20 – Virtual Elements (ABAP Functions) in CDS
- UI5 Tooling – Develop UI5 Apps in the Editor of your Choice – 1
- UI5 Tooling – Consume OData Service via UI5-Middleware-SimpleProxy – 2
- SAP OData. Part 15 – Expected type is ‘Edm.DateTimeOffset’ Error
- CDS – 26: Analyzing CDS with Analytical Annotation and Manipulating its Filter Options












Hello Experts,
Thank you very much by providing such friendly,understanding and great learning platform.
really much appreciated.
can you please look into access issues for below links.
ABAP on SAP HANA. Part X. AMDP with SELECT OPTIONS
ABAP on SAP HANA. Part XI. Are Native SQL and Open SQL Competitors?
Thanks,
Chandrakant
Dear Chandrakant – Thank you for reporting the site issue. We have fixed it. You may check the pages without error.
Please keep visiting and supporting us. Please share our links with your friends, colleagues and team members.
Team SAPYard.
When using AMDP, one of the biggest issues I’ve seen is when ABAP parameters are passed down and then applied as a filter. The SQL in the AMDP ends up creating an initial huge results set, and then applies the filter. Better is to think carefully on the selection criteria and only supply parameters that can be used directly in the SQL statement, rather than used as a filter at the end. This may reduce the user’s ability to make some pretty wild selections, but will greatly improve the performance of the AMDP query.
Thank you Stephen for this insightful feedback. AMDP is still a new area for many developers. Your comments would help. Can you please provide one document with the sample code which we can publish. We would name the article as Performance Optimization in ABDP. We will publish it in you name. Please email it to mailsapyard@gmail.com.
Thanking you.
Team SAPYard.
Very good details about the difference between CDS, AMDP and OPEN SQL. Thanks a lot!!!!
Thank you Shridhar. Glad you liked our article. Please keep visiting. Please share our links with your friends, colleagues and team members.
Regards,
Team SAPYard.