ABAP Programming Model – 3 – Creating CDS Views in SAP Fiori

SAP Fiori : ABAP developers should no longer be surprised by or limited to Core Data Service. Developers of ABAP and CDS ought to get along like water and milk. This course will help you get one step closer to learning and comprehending Core Data Services if you haven’t yet embraced CDS.

Let’s get our application’s data model started. Generally speaking, it is excellent practice to build a package and include the data model that CDS views will construct.

Make a Package
Create a package using the SE80 transaction as shown below;

Build a data model with CDS Views.


Assume for the moment that the airline industry data model exists. The airline industry will own information pertaining to carriers and flight schedules.

Now that we have this bare minimum requirement, let’s get the data model built. Three common database tables are used in this scenario:

SCARR: Airline Details.
SFLIGHT: Information about flights.
Flight schedule information for SPFLI.
We will develop three distinct basic Interface(I_) views using the three standard tables mentioned above.

How to Make CDS Views


Verify that the ADT components are correctly installed in Eclipse and connect the SAP system to the Eclipse environment.
Start generating CDS Views in the created package by performing a right-click on the Package and selecting New -> Other ABAP Repository object, as demonstrated below.

  1. The wizard for creating an ABAP repository object will then show up. Enter “Core” as the first character in the wizard’s filter box.
  1. Click Next after choosing Data Definition from the filtered list.

Click Next after entering the Name and Description for the data definition.

  1. Select Define View, then press the Finish button.
  1. The following Data Definition will be created:

Type the SQL View name to be generated in @ABAPCatalog.sqlViewName and replace the data_source_name with SCARR (in our example, this is ZAPF_SCARR in the first line). Next, add the elements that must be visible in the view.

Confirm, save, and turn on the data definition. As stated in the previous chapter, DDL SQL View will be activated after

The essential perspectives are now available. To prepare the data model for the Fiori App, let’s further transform these views into Composite views and additionally construct Consumption views (C_). The data model that we are attempting to create and offer as a Fiori app through an OData service is shown below.
Combined Views.

To create Composite views, let’s execute Association between the Basic views. Join us on the airline (ZAPF_I_AIRLINE) and flight information (ZAPF_I_FLIGHTS) associations. For the remaining views, we then create associations as shown in the Data Model diagram above. The snapshot showing the relationship between the views is shown below.

Views on Consumption


We will construct Consumption views with selection on these composite views and then association on all three Consumption views, much like Composite Views.

n the ABAP Programming Model for SAP Fiori, Core Data Services (CDS) views play a pivotal role in defining and managing data structures. CDS views are essentially SQL-based views that offer a powerful and flexible way to model data in the SAP system. They enable developers to define complex queries and data relationships in a reusable and maintainable manner. By using CDS views, you can enhance data access performance and leverage advanced features like annotations and access control.

Conclusion:

Mastering CDS views is crucial for effective SAP Fiori development. They provide a robust framework for structuring data, which is essential for creating dynamic and efficient Fiori applications. Understanding how to create and utilize CDS views will significantly streamline your development process and improve the performance of your SAP solutions.

you may be interested in this blog here:-

What is ERP?

How do I become a Oracle SQL Developer?

Salesforce course with placement in Pune

Related Posts

Part 28 of Advance SAPUI5: SAPUI5 Responsive Table – Contextual Width

One of the most popular aspects of a responsive table is its automatic contextual width. Automatic contextual width refers to the way columns change from covert to popin content and…

Accounting Entries for Inventory

A vital component of corporate operations is inventory management, which makes sure that products are properly recorded, valued, and accounted for. In addition to showing a company’s financial health, accurate…

Leave a Reply

Your email address will not be published. Required fields are marked *

You Missed

Part 28 of Advance SAPUI5: SAPUI5 Responsive Table – Contextual Width

  • By Varad
  • February 27, 2025
  • 23 views
Part 28 of Advance SAPUI5: SAPUI5 Responsive Table – Contextual Width

Accounting Entries for Inventory

  • By Varad
  • February 26, 2025
  • 29 views
Accounting Entries for Inventory

How may an existing ABAP report be converted to OOPs ABAP

  • By Varad
  • February 25, 2025
  • 40 views
How may an existing ABAP report be converted to OOPs ABAP

Advanced SAPUI5 – Part 26 – SAPUI5 Grid Table Sorting Feature

  • By Varad
  • February 24, 2025
  • 37 views
Advanced SAPUI5 – Part 26 – SAPUI5 Grid Table Sorting Feature

Upgrade SAPUI5-14: Utilizing SAPUI5, Create an e-Signature Pad

  • By Varad
  • February 23, 2025
  • 49 views
Upgrade SAPUI5-14: Utilizing SAPUI5, Create an e-Signature Pad

Important Tables with SAP FI

  • By Varad
  • February 22, 2025
  • 27 views
Important Tables with SAP FI