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

Important T codes for FI GL AR AP

Details of T Codes Accounting for Finances SPRO Put in the IMG OX02 Company Code to Create, Verify, and Delete OX03. Create Business Area Functional Areas for OKBD OB45 Establish…

Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

A few days ago, one of my SAP BI/BW friends requested a program that would accept any table as input and download it as a file to the local machine.…

Leave a Reply

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

You Missed

Important T codes for FI GL AR AP

  • By Varad
  • December 21, 2024
  • 19 views
Important T codes for FI GL AR AP

Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

  • By Varad
  • December 20, 2024
  • 13 views
Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

Error While Setting Up Trusted System RFC

  • By Varad
  • December 19, 2024
  • 11 views
Error While Setting Up Trusted System RFC

 Credit Management T codes in SAP

  • By Varad
  • December 18, 2024
  • 24 views
 Credit Management T codes in SAP

Troubleshooting SAP BD22: Delete Change Pointer Not Picking Correct Processed Messages

  • By Varad
  • December 17, 2024
  • 56 views
Troubleshooting SAP BD22: Delete Change Pointer Not Picking Correct Processed Messages

Working with Shell Scripts in SAP ABAP Environment

  • By Varad
  • December 16, 2024
  • 34 views
Working with Shell Scripts in SAP ABAP Environment