Dear SAPLearners, in this blog post we will learn and understand View-on-View concept in ABAP CDS Views.
We all know that CDS views are based on single database table or on a Join of several database table.
At some times we tend to retrieve all required data by adding many tables with complicated join in a single CDS view. This is not best practice to follow.
To improve re-usability and readability of CDS views, they can be split into different CDS views and use in another CDS views.
In CDS you can define CDS views that are based on one or more CDS views. This is called as “View-on-View” or some times referred as “Nested Views“.
In nested views, a join of CDS views and join of CDS view with database table is supported. There is not technical limitation for nesting depth and complexity of CDS views.
The main advantages by following this approach are
A common code logic is defined in one basis view that is used in several other CDS views instead of maintaining identical expressions.
Instead of complicated join of many tables, join of 2 CDS views is more readable.
The Dependency Analyzer view for CDS view provides you the information about the database tables and other CDS views used in a particular view.
To see the Dependency Analyzer for CDS View right click on CDS View and select Open With and Dependency Analyzer.
Congrats!! you have successfully learned about View-on-View concept in ABAP CDS Views or Nested ABAP CDS Views. Stay tuned for more ABAP CDS View Tutorials
Please feel free to comment and let us know your feedback. Subscribe for more updates
If you liked it, please share it! Thanks!
Click here to join our channel and stay updated with the latest tutorials and updates.