cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDS - define view vs define root view

Former Member
19,110

Hello together,

The nice thing about the new SAPUI5 world is that you can/must learn something new every day.

We bought the book "Core Data Service for ABAP" and in the code examples for the book we use the command 'define root view'. I have 2 questions about the CDS command 'define root view'.

1) From which SAP release is this command possible?

2) Can someone explain in simple words what the difference is between 'define view' and 'define root view'.

As I can understand, 'define root view' is a BDL command and 'define view' is a DDL command. DDL is still known from SQL but BDL is new to me.

Here are the links to the SAP help:

define root view

define view

Best regards
Uwe

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hello together,

Thanks for your answers.

I have written to the authors of the book mentioned above.

The functionality is introduced with the "ABAP Restful Programming Model" and is available as of SAP NW Version 7.54 (1909).

The following two links give a nice overview, when which CDS functionality was added:

ABAP Restful Programing language

Keyword Documentation - Release changes

Best Regards
Uwe

Answers (3)

Answers (3)

geert-janklaps
SAP Mentor
SAP Mentor

Hi,

This command is available as of NetWeaver 7.51 if I'm not mistaking (with the release of the ABAP Programming Model). (not 100% sure, but should give you an idea)

Basically the "define view" just creates a regular database view (like would have done using SE11, only with a lot more / advanced functionality).

Define root view is used when creating business objects with the ABAP (Restfull) Programming Model and used to define the view as the root / base view of your business object. (e.g. for a sales order your root view would be a view based on table VBAK which contains the sales order header data)

An example using CDS business object based development can be found in this blog.

Best regards,

Geert-Jan Klaps

Former Member

Hi

it seems that in this version of S4HANA 1709 CDS Data modeling is through Virtual Data Model annotations (Basic, Composite and Consumption). And for example in actual versions of S4HANA and ABAP Platform as a Service this regards to ROOT and 'Association to Parent' DDL keywords.

Checkout this remarkable post:

https://blogs.sap.com/2019/06/06/embedded-cds-view-exposure-to-fiori/

You'll find a good explanation by example throughout the post.

Regards.

Former Member
0 Likes

Hello,

Super. Thanks. This is also what we want to develop (Transactional applications or Restful).

Currently I get the following error in Eclipse: Instead of 'root', 'view' or 'table function' was expected.

Actually we have the following release:

  • SAP S/4HANA 1709
  • SAP_BASIS 752 0000
  • SAP_ABA 75C 0000
  • SAP_GWFND 752 0000
  • SAP_UI 752 0004

Is this not enought? Which package needs to be updated?

Best Regards

maheshpalavalli
Active Contributor
0 Likes

It's available from s4 1909

Former Member
0 Likes

Is that (define root view…) not a part of SAP_BASIS package?

I thought that this packages (SAP S/4HANA 1709, SAP S/4HANA 1809, SAP S/4HANA 1909...) only contains SAPUI5 Applications and their Gateway Services.