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

An Overview of SAP Fiori ABAP Programming Model – 1

Fiori is at the forefront with S/4HANA.Additionally, in order to create SAP Fiori Applications, ABAP engineers must transform into stunning butterflies in order to sip the delightful nectar of the…

Leave a Reply

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

You Missed

“A Strategic View of SAP Fiori: Insights from a Space Level Perspective”

  • By Varad
  • October 1, 2024
  • 5 views
“A Strategic View of SAP Fiori: Insights from a Space Level Perspective”

An Overview of SAP Fiori ABAP Programming Model – 1

  • By Varad
  • October 1, 2024
  • 5 views

SAP Fiori ABAP Programming Model – 2 – CDS – Overview

  • By Varad
  • September 30, 2024
  • 3 views
SAP Fiori ABAP Programming Model – 2 – CDS – Overview

130 SAPUI5, SAP Fiori, HTML, CSS, JavaScript & jQuery, Interview Questions & Answers

  • By Varad
  • September 28, 2024
  • 3 views
130 SAPUI5, SAP Fiori, HTML, CSS, JavaScript & jQuery, Interview Questions & Answers

ABAP Programming Model – 4 – OData Service Generation for SAP Fiori

  • By Varad
  • September 27, 2024
  • 2 views
ABAP Programming Model – 4 – OData Service Generation for SAP Fiori

ABAP Programming Model – 5 – OData Service Generation for SAP Fiori

  • By Varad
  • September 26, 2024
  • 9 views
ABAP Programming Model – 5 – OData Service Generation for SAP Fiori