cancel
Showing results for 
Search instead for 
Did you mean: 

When to use Define View Entity / Define View ?

06-17-2021 8:01 AM
26600 views 5 comments
Subscribe

In the context of RAP, we are using "define root view entity" for main projection CDS View as well as Main Interface CDS View, as that is the main entity of the business object.

For the remaining composition views, we are using "define view entity" without root keyword, as that is not the top most entity of the business object.. This much I have understood.
But In our company, we are using remaining all dependent cds views which are used for value helps, for getting texts...etc, using "define view" with out even entity....

I read few blogs and got basic differences between "define view entity" and "define view", as one got ddic view, for other no need.

But when exactly we need to use define view / define view entity ?

Can we use for all cds views.... define view entity , except root view ?

Kindly share your knowledge on this.

Thanks in advance.

View Entire Topic
beyhan_meyrali
Active Participant
CarineTchoutouo
Product and Topic Expert
Product and Topic Expert
0 Likes

Yes, the usage of CDS view entities - instead of CDS DDIC-based views - is recommended on SAP BTP ABAP environment (aka Steampunk) and on-premise starting with SAP S/4HANA 2020.

  • CDS view entities --> DEFINE VIEW ENTITY [recommended]
  • CDS DDIC-based views --> DEFINE VIEW

More blogs on ABAP CDS can be found here.