CDS View entity with join and literals Part 6 ABAP on HANA Course
Summary
TLDRThis video tutorial covers enhancing a CDS (Core Data Services) view entity in SAP. It begins by explaining how to fetch data from multiple data sources using joins, including fetching from different tables like VBAK and VBAP. The video walks through creating select statements, adding conditions, using literals, and applying alias names for better readability. It also demonstrates how to preview data, apply conditions, and create a program to consume the CDS entity. The video concludes with insights into using different features, including select lists, aggregates, and the distinctions between CDS views and database views.
Takeaways
- 🛠️ The video focuses on enhancing a CDS view entity created in a previous video by joining multiple data sources (tables) to retrieve and display data.
- 🔄 The tutorial explains how to use joins in CDS view entities, specifically an inner join between VBAK and VBAP tables, which share a common sales order number field.
- 📋 Demonstrates the use of literals in field lists to display constant values in the output of a CDS view entity.
- 🚀 At the end of the tutorial, the CDS view entity is called in an ABAP program to retrieve and display data.
- 🧑💻 The CDS view can pull data not only from database tables but also from other CDS views, table functions, hierarchies, and other CDS-based views.
- 🔍 Shows how to preview the data after enhancing the view and applying inner joins, with alias names being used to make the fields more readable.
- 📊 The video emphasizes that the capabilities of SQL and Open SQL enhancements in HANA can be leveraged to create more powerful CDS view entities.
- ⚙️ Demonstrates how to use filters or WHERE conditions in the CDS view to retrieve specific data, such as filtering by a particular sales order.
- 📦 Aggregation, arithmetic operations, and other expressions (e.g., SUM, AVG, CASE, string operations) can be applied within CDS view entities similar to SQL select statements.
- 🚫 The SELECT * operation is not supported in CDS view entities but is allowed in DDIC-based CDS views, highlighting the difference between the two types of views.
Q & A
What is the main focus of the video?
-The main focus of the video is to enhance a CDS view entity by getting data from multiple data sources using joins and displaying it in a preview. The video also covers the use of literals in the field list and demonstrates how to use the CDS view entity in an ABAP program.
What is a CDS view entity, and how is it used in this video?
-A CDS (Core Data Services) view entity is a type of view in SAP that allows for complex data modeling and operations. In the video, the presenter uses it to join multiple tables, add additional fields, and perform various SQL operations. The result is then displayed in a data preview and used in an ABAP program.
Which tables are being used for the join operation in the CDS view entity?
-The tables used for the join operation in the CDS view entity are `VBAK` (Sales Document Header) and `VBAP` (Sales Document Item), which are joined based on the common field `VBELN` (Sales Order Number).
What is the purpose of using literals in the CDS view entity?
-Literals are used to define constant values in the select list. For example, the presenter uses a numerical literal (`0.23`) and a character literal (`'CDS'`) in the field list to demonstrate how to include constant values in the output.
What is the difference between using dot (`.`) and tilde (`~`) operators in the select statement?
-In the video, the presenter explains that in CDS views, the dot (`.`) operator is used to refer to fields in the select list or join conditions instead of the tilde (`~`) operator, which is used in traditional ABAP SQL syntax.
What are the key differences between a CDS view entity and a traditional DDIC-based view?
-The key differences include: (1) A CDS view entity cannot use the `SELECT *` syntax to fetch all fields, whereas a DDIC-based view supports it. (2) A CDS view entity cannot use a name list (a list of fields without alias names) in the field list, while a DDIC-based view can.
How do you display data from a CDS view entity in an ABAP program?
-To display data from a CDS view entity in an ABAP program, the presenter creates a select statement that references the CDS view entity, selects specific fields, and stores the data in an internal table. The internal table is then passed to the `cl_demo_output=>display` method to display the data.
What are some common SQL operations demonstrated in the CDS view entity?
-The video demonstrates several common SQL operations in the CDS view entity, including joins, aliasing fields, filtering data using the `WHERE` clause, and using literals and constants. It also mentions that arithmetic operations, aggregations (e.g., SUM, AVG), and string functions can be used.
Why is aliasing used in the CDS view entity, and what are its benefits?
-Aliasing is used to provide meaningful names to columns or tables in a CDS view. This improves readability and makes it easier to understand the query. In the video, the presenter aliases the `VBAK` and `VBAP` tables as `header` and `item`, respectively, to represent the data structure more clearly.
What is the purpose of the `cl_demo_output` class in the ABAP program?
-The `cl_demo_output` class is used to display the contents of an internal table in an ABAP program. In the video, the presenter uses the `cl_demo_output=>display` method to show the results of the CDS view entity in a readable format.
Outlines
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowMindmap
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowKeywords
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowHighlights
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowTranscripts
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowBrowse More Related Video
CDS View with input parameters Part 7 ABAP on HANA Course
Association in cds view abap CDS Part 9 ABAP on HANA Course
Part 8 - Data Loading (Azure Synapse Analytics) | End to End Azure Data Engineering Project
Learn Excel Pivot Tables in 10 Minutes - A complete beginner's tutorial
Generate C# Model from existing Microsoft SQL Server Database
Learn Basic SQL in 15 Minutes | Business Intelligence For Beginners | SQL Tutorial For Beginners 1/3
5.0 / 5 (0 votes)