One of the foundational elements of all SAP Fiori , ABAP Programming Model – 2 – CDS – Overview ,SAP S/4HANA application types is Core Data Services (CDS). They facilitate the creation of semantically rich data models that support code push-down to the SAP HANA database and are implemented on top of new S/4HANA or ECC tables. In addition to offering three training batches on ABAP CDS, we have a comprehensive tutorial series on CDS.
Beginners of ABAP CDS who wish to continue with the ABAP Programming Model in SAP Fiori without having to navigate and bounce between pages would find this tutorial to be helpful. However, if you want to go deeper into it, we strongly advise you to take our Core Data Services training series.
What transpires when CDS View is created?
When a CDS view is activated, two artifacts are produced: a CDS View Entity, which is a SAP HANA view on the database, and a corresponding SQL View, which is the Data Dictionary (DDIC) view in the ABAP Dictionary (@AbapCatalog.sqlViewName). With the object repository entry R3TR DDLS, just the CDS View definition is sent. Different sorts of annotations can be used to augment CDS views, which are built using CDS’s Data Definition Language (DDL), to cover various application scenarios.
Navigate to transaction SE11; the above-highlighted view will appear in the ABAP DDIC view options.
CDS Views’ naming convention
The following naming conventions are used to categorize CDS Views:
Private View (P_)
View Interface (I_)
Using Perspective (C_)
Exclusive Perspective
Private Views are made for internal use and will be accessible everywhere. Developers can build associations with this Private view or utilize it to develop CDS views.SAP does, however, advise users not to use Private views as they are not safer.In the future, certain columns might be added or removed in a way that would hinder our development because it depends on these viewpoints.
Please keep in mind that this does not mean we should never embrace their opinions. Steer clear of consumption if possible.
View of the Basic Interface
View of the Composite Interface
From a technical standpoint, Basic and Composite views differ in:
Master data is contained in Basic View, whereas both Master and Transactional data are contained in Composite View.Using I_ conventions, the Basic and Composite Interface views are identified.
View of Consumption
Interface views serve as the foundation for this view. This view serves as the data model’s pre-made solution. It is also much simpler to design and use a Fiori App using these views. It can also be used analytically; BI reports, for example, can be created. It is easy to develop if SAP already provides the Consumption views.
Key Features of CDS:
- Semantic Layer: CDS views offer a business-oriented abstraction layer over raw data, making it easier for developers and end-users to interact with complex data structures.
- Performance Optimization: Leveraging SAP HANA’s in-memory processing, CDS views are designed to optimize performance, enabling fast and efficient data retrieval and manipulation.
- Reusability: CDS views can be reused across different applications, reducing redundancy and ensuring consistency in data representation.
Practical Application of CDS Views
Implementing CDS views involves several steps, each crucial for ensuring that data is modeled and utilized effectively:
1. Defining CDS Views: The first step is to define the CDS views using the ABAP Development Tools (ADT) in SAP HANA Studio or Eclipse. This involves creating a CDS view definition that specifies the data source, fields, and any necessary calculations or aggregations.
sqlCopy code@AbapCatalog.sqlViewName: 'ZMY_CDS_VIEW'
@EndUserText.label: 'My CDS View Example'
define view Z_MY_CDS_VIEW as select from some_table {
key field1,
field2,
sum(field3) as total_field3
}
group by field1, field2
2. Exposing CDS Views as OData Services: To integrate CDS views with SAP Fiori apps, they need to be exposed as OData services. This is done using the SAP Gateway, which allows Fiori apps to consume the data via standard web protocols.
3. Integrating with Fiori Apps: Once the OData service is set up, it can be consumed by Fiori apps. Developers configure Fiori tiles and applications to use the OData services, ensuring that the data presented aligns with the business requirements.
4. Testing and Validation: Thorough testing is essential to ensure that the CDS views deliver accurate data and perform well under different scenarios. This includes validating data accuracy, performance, and the user experience in Fiori apps.
Conclusion
Core Data Services (CDS) views are a fundamental component of the SAP Fiori ABAP Programming Model, offering a powerful framework for data modeling and integration. By providing a semantic layer over raw data, CDS views enable developers to create efficient, real-time, and user-centric applications. Their ability to simplify data modeling, optimize performance, and enhance user experience makes them indispensable for modern SAP Fiori development.
Implementing CDS views effectively requires careful planning and execution, from defining the views to integrating them with Fiori apps. Embracing CDS views not only streamlines data management but also ensures that SAP Fiori applications deliver meaningful and actionable insights to users. As organizations continue to evolve and leverage advanced technologies, understanding and utilizing CDS views will remain a key factor in achieving success and driving innovation in the SAP ecosystem.
you may be interested in this Blog Here
Can I become full stack developer in 3 months?
Salesforce Incident Management: Streamlining Issue Resolution
How the Digital Services Act is Shaping the Future of the SAP Community