Skip to content

alikapllan/cds_views

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CDS Views

-> All CDS Annotations

Access Control

image -> Access Control Simple Condition Example
-> For PFCG Aspect you need to create Authorization Field & Authorization Object/s
-> Access Control could also be inherited from another CDS View Role
-> More info can be found in the video from SAP Developers
-> Another helpful source about Implementing Authorizations from SAP Learning

-> Extending with Association image

-> Passing Parameters in ABAP

-> Tables joined via association are only selected in case that the caller (e.g. the SELECT-statement in ABAP) wants to have at least one field of the related table. But tables with joins are selected anyways no matter what is accessed. Therefore using associations comparing to joins could be considerable as this could increase runtime access in such cases.

-> Implementation Example AMDP
-> Why we have the need to consume AMDP in CDS?
When database requires specific functions which open SQL does not have, then we need to consume AMDP in CDS.For example, when we need to perform complex calculations in CDS, sorting or deleting multiplied data. This can be achieved through AMDP.
-> More Info could be found in this blogpost in SAP Community.
-> SAP Documentation -> ABAP-Managed Database Procedures (AMDP)

CDS Types and Enums

-> Replacement of Data Elements in the ABAP Dictionary
-> Source: SoftwareHeroes - CDS Types and Enums

Tools for Analyzing Exisiting CDS Views

-> a very nice blog from Software Heroes on this topic.

Additional - HANA PlanVisualizer(PlanViz)

-> The Plan Visualizer, or PlanViz tool, in SAP HANA is essential for understanding query runtime performance. By analyzing queries with PlanViz, you can identify where the query spends the most time, making it easier to troubleshoot performance issues effectively.

How to use?

  • Go to ST05 and start tracing
  • Run your CDS you want to analyze
  • After result go back to ST05 and stop tracing
  • Download the trace in .plv format and in ADT switch to SAP Hana PlanViz Perspective and open the file you downloaded

image

SAP Developers - Video Series about Core Data Services

  1. ABAP Core Data Services Overview
  2. Virtual Elements
  3. CDS View Extensions
  4. CDS Access Control
  5. CDS Unit Test
  6. CDS Troubleshooting
  7. CDS Annotations
  8. CDS Associations

View Entities

Custom Entities

allowing developers to implement their own data retrieval using ABAP by custom implementation. It is linked with an ABAP Class the retrieval execution is done on application server.
--> SAP Help Portal - Custom Entities
--> Using a CDS Custom Entity for Data Modeling in RAP
--> An Use Case Example

Abstract Entities

is a CDS entity that does not correspond to a database table or view, serving as a template or base definition. It is used to define common structures, fields, and associations that can be inherited by concrete entities.
--> SAP Help Portal - Abstract Entities

External Entities

enabling ABAP applications to access data from external systems using SQL and integrate it into the CDS infrastructure. This allows data retrieval and interaction between the ABAP system and external databases, whether they are SAP HANA or non-SAP HANA systems, or a remote AS ABAP. CDS external entities serve as persistent entities within the ABAP environment for this purpose.
--> SAP Help Portal - External Entities
--> Blog Post - ABAP CDS Release News 2408 – External Entities
--> Data Integration in ABAP Cloud with SQL services and CDS External Entities

View Types

image

Basic/Interface Views

Purpose:

  • Used for Data Read from Tables

Composition Views

Purpose:

  • Composition Views are used to build more complex views by combining multiple basic views. They serve as intermediate views that aggregate, transform, and join data from underlying basic views (Private Views or other Composition Views).

Usage:

  • They help structure and organize data models by encapsulating complex logic and calculations.
  • Composition Views can be reused across different parts of the application or different applications, providing a standardized data foundation.

Consumption Views / Projection

Purpose:

  • Consumption Views are designed for direct use by applications, reports, or analytical tools. They represent the final layer in the view hierarchy, optimized for specific reporting and analytical needs.

Usage:

  • These views present data in a format suitable for end-user consumption, often including annotations for UI purposes, authorization checks, and other metadata to facilitate use by Fiori apps, OData services, etc.

Additional Information:

In certain scenarios, Composition Views can be used as Consumption Views, particularly when the data model is straightforward and the Composition View meets the requirements for direct consumption. However, for more complex scenarios and to adhere to best practices in maintainability, reusability, and optimization, it is generally advisable to maintain a clear distinction between Composition Views and Consumption Views.

image image

How it looks in Fiori

image image

CDS Field Mapping app by Software-Heroes

this nice app gives new Core Data Services including field names as successors for old tables.
image

About

CDS Views Snippets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published