Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
horst_keller
Product and Topic Expert
Product and Topic Expert
149,971


If you search the web or SCN for CDS, SAP's Core Data Services, you can easily find statements like "Core data services (CDS) is an infrastructure for defining and consuming semantically rich data mode....". On the other hand, there also seems to be something called ABAP CDS in ABAP Dictionary. How are they connected? Let's have a look from the ABAP (and even ABAP CDS) docu writer's worm's eye view.

ABAP Dictionary

In order to develop (business) applications, you need something to model your data. In the ABAP world, meaning on the ABAP application server, for this purpose you used the ABAP Dictionary or tools like the data modeler for years. The ABAP Dictionary was and is the platform independent metadata repository for database tables and database views that can be accessed in ABAP using Open SQL. The definition of the database entities is done in the form based ABAP Dictionary tool on the application server and  the according DDL is passed to the database via the DBI (Database Interface). You can examine that by looking at the "Database Object" in SE11. E.g., for a view, you see the according DDL statement CREATE VIEW.  For an ABAP program, the entities defined in the ABAP Dictionary act like global types, making it simple to declare ABAP data objects as targets or sources for DML statements in Open SQL.

HANA CDS

With the dawn of SAP HANA and the possiblity to develop applications directly on the database, not using an application server any more, the need arised, to create a meta model repository directly on the database. As with the ABAP Dictionary on the application server, there should be more in the box for you than using native SQL's CREATE TABLE or CREATE VIEW. Especially regarding the need of enriching pure technical definitions wih semantics. And that's one of the main reasons for SAP's Core Data Services.

Core Data Services provide a specification for an SQL-based DDL that is enriched with further possibilities like annotations or associations that generally can be implemented on different platforms. On SAP HANA, CDS provides the possibility "to define the artifacts that make up the data-persistence model." The DDL of CDS allows you  to define database tables, database views, data types by wrapping the according native HANA SQL statements and enriching them with semantical properties. From an ABAP programmer's point of view, one might say: Well, OK, there's a source code based dictionary tool directly on the HANA database. But that would be too shirt-sighted.

ABAP CDS

From the beginning, CDS was not designed for HANA alone. Also the ABAP application server should be able to benefit from the enhanced capabilities that are offered by the DDL of CDS compared to the form based ABAP Dictionary tool. Since the ABAP Dictionary with its capabilty of defining tables, views and data types was already there, the natural way of introducing CDS on the ABAP application server was to add it to the ABAP Dictionary. An ADT based source code editor allows you to create DDL sources. On activation,  the CDS entities defined in such a DDL source become full citizen ABAP Dictionary objects. They work as ABAP types that can be named after a TYPE addition and they can be accessed in Open SQL. As a first step, the advanced view building capabilities of CDS have been implemented in ABAP CDS. With many, many tables already defined in the ABAP Dictionary, the DEFINE VIEW statement of ABAP CDS makes the full wealth of the CDS universe readily available to existing ABAP data models. You can either define sophisticated new views or simply wrap an existing table in a CDS view in order to enrich it semantically. For example, ABAP CDS offers a new authorization concept based on roles defined wih DEFINE ROLE (partly released wth 7.40, SP10 and fully released with ABAP 7.50) in a DCL source code. In order to let an existing table participate in the new authorization concept, you can simply create a CDS view for that table that is connected to a role. Other examples are advanced joining of tables with associations or using specific annotations in order to connect existing tables to new technologies like OData or UI5. Even in ABAP itself, CDS views are handled in an advanced way compared to classical dictionary objects - automatic client handling is an example. So, with introducing CDS views in the ABAP Dictionary one big step is already taken. Capabilities to create database tables, database functions (available with ABAP 7.50), and data types in ABAP CDS might follow. This would ultimately allow you to create data models in the ABAP Dictionary from scratch using ABAP CDS only.

ABAP CDS vs. HANA CDS


With HANA CDS and ABAP CDS we have two implementations based on the same specification. The implementations are very similar but not 100 % equal.  If you know the DDL of CDS, you should be able to understand definitions of CDS entities in both flavors. But as a rule you will not be able to copy DDL sources from HANA to ABAP and vice versa without modifications.  The implementation of HANA CDS and ABAP CDS is ongoing and with different priorities.That's why a blog like New Core Data Services Features in SAP HANA 1.0 SPS 10  is mainly interesting for developers working directly on SAP HANA. ABAP developers have to look for blogs like news in ABAP CDS.

While HANA CDS has to function on SAP HANA only, ABAP CDS is open. Consequently there are some restrictions for ABAP CDS that do not exist for HANA CDS (in the same way as Open SQL is more restricted than Native SQL). A good example are built-in functions. A built-in function like CURRENCY_CONVERSION offered in ABAP CDS must be available on any database platform and  - very important - must behave in the same way on all platforms. Same for expressions like arithmetic expressions, aggregates or the CAST expression. Before releasing such a functionality in ABAP CDS, all platforms have to participate. Quiet a task!  And thats why ABAP CDS cannot offer all SQL Functions of SAP HANA yet (but working on it ...). On the other hand,it is open! And there are also ABAP specialties like client handling or table buffering that are not available in HANA CDS, but supported in ABAP CDS.

Conclusion

SAP's Core Data Services provide a single concept for an infrastructure for data modelling that is implemented  in SAP HANA as well as on the ABAP application server. The design principles are the same for both implementations but due to differences in the respective environments, there are naturally some differences between these flavors.

Note

To my knowledge, there is no native implementation of the CDS concept on other database platforms than on SAP HANA up to now. In order to model in CDS for databases other than HANA, you can of course use ABAP CDS in the ABAP Dictionary, and let it push down the model for you.

72 Comments
horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

 

From a technical perspective, CDS views can be extended using DDL statement EXTEND VIEW. For annotations we have metadata extensions. Switchable extensions are under discussion. Other questions regarding extensibility that go beyond this technical perspective regard the frameworks and applications that use CDS views and must be addressed to those.

Former Member
0 Kudos
 

Sorry to confuse you, I was referring to SAP Enhancement Framework like transaction SE18 and SE19.  CDS View CRUD operations have to take into considerations these backend enhancements.  So I believe CDS views are relevant only for custom tables and custom applications without relevance to SAP applications.  Or re-implement these enhancements in the reports or in the CDS view.

For my case, working on BO Design Studio, CDS View as transient information provider, I have no way to go around in S/4 HANA embedded analytic.  Right now there’s no way to report, other than using these transient provider.  With BW, we used to do extract using the BAPI information to BW so it was OK.
Former Member
0 Kudos
S/4 HANA uses embedded analytics, which uses CDS views with annotations for transient providers.  Please check the documents.  It would be better to use BO Design Studio or Lumira then WEBI.
DotEiserman
Product and Topic Expert
Product and Topic Expert
0 Kudos
 

Thank you Horst! This comment thread was really insightful.
ilyasahmed
Explorer
0 Kudos
Thank you Horst,

This is much needed explanation to clarify between ABAP CDS and HANA CDS.
0 Kudos
Hello Horst,

First of all, congratulations for the very good disambiguation and comparison between ABAP CDS vs. HANA CDS.

My team is working on searches built on HANA DB and we are currently not using any form of CDS. Can you point me where I can find about some of the advantages/disadvantages of switching to the CDS approach?

Kind regards,
Eduardo
horst_keller
Product and Topic Expert
Product and Topic Expert

Annotations for metadata:

See e.g.  https://blogs.sap.com/2015/11/13/abap-news-for-release-750-annotations-in-abap-cds/ 

Associations for modelling:

https://blogs.sap.com/2016/08/12/from-open-sql-joins-to-cds-associations/

former_member481183
Discoverer
0 Kudos
Greetings Horst,

I found your blog a key source of reliable information on CDS.

Perhaps you can let us know whether any reference materials are planned beyond the online help and keyword documentation? I think there would be strong demand in the market for a book.

There are 2 specific points I've been struggling to resolve:

  1. A comprehensive description of view types, their purposes and limitations. For example, an API view type was introduced in a teched presentation, but I don't have more detail than the naming standard

  2. Which view type(s) should be protected by DCL? In my tests so far, only the DCL on a consumption view has been effective.


For context, my background is abap, and my focus is use of CDS views to provide data to external applications & non-SAP platforms

Thank you,

Bill
horst_keller
Product and Topic Expert
Product and Topic Expert
ssurampally
Active Contributor
Hi Horst, With HANA 2.0 We have Graphical interface to create Native CDS artifacts using Web IDE for HANA, any near future plan to get ABAP CDS Views in Graphical editor?
varun_rao
Advisor
Advisor
0 Kudos
A succinctly written blog. Thanks Horst.
Hi Horst,

this statement you wrote in November 2015:

"If you do not want to access the CDS entities in ABAP as data types or in Open SQL, you can use HANA CDS, which is better integrated into SAP HANA. An access from ABAP is then possible using Native SQL (ADBC, AMDP) only."

What about today? Is your statement still valid? Or is there anything new on the ABAP CDS approach, that we can leverage from? Is the integration of HANA CDS Views into HANA in comparison to ABAP CDS into HANA still better?

Do you know about any performance test comparisons between ABAP CDS, HANA CDS, and HANA Calculation views?

I've heard, that SAP itself is delivering more and more ABAP CDS views instead of HANA calculation views in the area of S4/Fin, but maybe this was SAP BW related. I'm not sure...

Best regards,

Thorsten

 
0 Kudos
Hi Horst,

One question .

We are facing one issue with one standard CDS view. Previously it has no parameters and we accessed it in other custom views using it's CDS DB view name (the sql viewname). After one note implementation this view got changed and currently it has a parameter but we can't access it in other custom view using it's  CDS DB view name (it is saying not able to find it in SAPFMS schema). 

We have also checked it in SE11 to check whether it has a consistent runtime object or not. It shows as consistent.

We tried to find the CDS DB view using DB02 . It was not able to find any.

At last we tried to use the cds Entity name in our custom CDS and it's working.

I have also checked that SAP strongly recommends to use the CDS entity then how it was working previously.

Thanks
Krishanu

 
horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

https://blogs.sap.com/2018/04/03/abap-managed-database-objects-and-how-to-access-them/

The way in which instances of ABAP-managed database objects are created is an internal affair of the AS ABAP. The actual implementation can change in incompatible ways when the release is upgraded.

0 Kudos
Hi Horst,

 

Nice article. And I'm new to SAP and ABAP world and trying to learn it, so bear with me if this is a stupid question.

At the end of the day, is there any difference in terms of the HANA capabilities like in-memory DB, dynamic parallelism, ect, in HANA CDS and ABAP CDS?

And also will there be any difference in the table creation in HANA Studio vs SE11 table creation in netwaver.

Thanks
0 Kudos

Hi Horst,

I am a complete beginner on the CDS view topic.

is the ‘DDL SQL VIew’ is the CDS view name?

What does DDL source represent?

How to know whether the CDS  view is a HANA CDS or ABAP CDS ? may be for the above example.

 

 

Best Regards,

Vijay

 

sapworkdir
Participant
0 Kudos
Hi Vijay.

 

@AbapCatalog means ABAP CDS.

@Catalog means HANA CDS.

 

Regards

Sergii
Astashonok
Participant
0 Kudos
Hello, Horst,
If you do not want to access the CDS entities in ABAP as data types or in Open SQL, you can use HANA CDS, which is better integrated into SAP HANA. An access from ABAP is then possible using Native SQL (ADBC, AMDP) only.

 

and what is the use-case for such HANA-only CDS use? You mean using them on standalone HANA servers where there is no AS ABAP? Are there such companies?
kiran_kodre
Explorer
0 Kudos

Horst: 

          In a very complex implementation, I think debugging issues related to CDS modeling is going to be a nightmare. 

Can you explain business scenarios where modeling a solution using CDS models will make more sense than using conventional ABAP data dictionary models (apart from security) 

My development team just spent time developing a complex application that involved developing objects right from data dictionary all the way to Web Screens and workflows batch jobs etc etc. The hardest most time consuming part for the whole experience was modeling the data dictionary and making changes to it as and when the application build was evolving. If you want us to improve database modeling quality or productivity we would like to have a high level entity modeling SDK that works right on top of SAP’s Data dictionary where we could simulate real world relational database scenarios that we can immediately reflect it to the data dictionary when desired. If there is already a tool that can do that appreciate if you can share it..

mohammedmuzammil
Participant
0 Kudos
Beautiful Blog - loved it!
former_member818952
Discoverer
0 Kudos
Hi Horst !

Thank you for the informative blog. This clearly points out the difference between ABAP CDS and HANA CDS. However, I was wondering how come semantically rich views "CDS" would solve complex modelling scenarios that we handle through ABAP. Are we allowed to use HANA CDS views in an ABAP program ? I guess only ABAP CDS views are allowed. Additionally, it would be interesting to know if both the views can be exposed to XSODATA services in HANA

Best Regards,

Piyush Garg
former_member818952
Discoverer
0 Kudos
Hi Horst

 

Thank You for the wonderful blog ! It clearly points out the differences between ABAP and HANA CDS views