Saturday, March 1, 2025

Finding CDS Views

To find CDS (Core Data Services) views in SAP, you can use several methods depending on whether you're searching in SAP GUI or SAP S/4HANA's Eclipse-based ABAP Development Tools (ADT).


1. Using SAP GUI (SE11, SE16, SE80, ST05, or RSRT)

Method 1: Using SE11 (Data Dictionary)

  1. Open SE11 (ABAP Dictionary).
  2. Select View and enter the name of a known CDS view (e.g., I_BillingDocument).
  3. If you don't know the name, enter E* or I* and use F4 Help to get a list of available views.

Method 2: Using SE16 (Table Browser)

  1. Open SE16 or SE16N.
  2. Enter Table Name: DDLSOURCE.
  3. Execute (F8).
  4. Apply filters like DPC*, I_*, C_*, or Z* for custom CDS views.

Method 3: Using SE80 (Object Navigator)

  1. Open SE80.
  2. Select Repository BrowserDictionary Objects.
  3. Search for objects starting with DDL or CDS.

Method 4: Using ST05 (SQL Trace)

  1. Start ST05.
  2. Activate SQL Trace and execute an SAP Fiori app or query.
  3. Check the trace for CDS view names used in queries.

Method 5: Using RSRT (BW Query Analyzer)

If using embedded analytics:

  1. Open RSRT.
  2. Use F4 Help to find BW Queries built on top of CDS views.

2. Using ADT (Eclipse) in SAP S/4HANA

Method 6: Searching in ADT

  1. Open Eclipse with ADT.
  2. Navigate to ABAP Development Tools.
  3. Use Ctrl + H → Select ABAP Repository Search.
  4. Enter a pattern like I_*, C_*, or Z* (for custom views).
  5. Press Search.

Method 7: Using ADT Project Explorer

  1. Open ADT.
  2. Expand your Package (e.g., Z*, S4CORE).
  3. Navigate to DictionaryData Definitions.
  4. View CDS definitions directly.

3. Using Tables for CDS Metadata

Method 8: Query Metadata Tables

You can check CDS views stored in SAP tables:

  • DDLSOURCE → Stores all CDS views.
  • DDLDEPENDENCY → Shows dependent objects of CDS views.
  • TADIR → CDS views can be filtered with R3TR DDLS.

Example SQL Query (SE16, SE11, or ST05):

sql
SELECT * FROM DDLSOURCE WHERE NAME LIKE 'I_%' OR NAME LIKE 'Z_%'.

4. Using Fiori Apps (SAP S/4HANA)

Method 9: Using "View Browser" App

If using Fiori:

  1. Open Fiori Launchpad.
  2. Search for "View Browser".
  3. Use filters to find CDS views by application component.

5. Using Custom ABAP Report

If you want to list CDS views programmatically, you can write a simple ABAP report:

abap
SELECT name FROM ddlsource INTO TABLE @DATA(cds_views) WHERE name LIKE 'Z%'. LOOP AT cds_views INTO DATA(view). WRITE: / view. ENDLOOP.

Summary

MethodTool
SE11Check Data Dictionary
SE16Query DDLSOURCE table
SE80Browse Repository
ST05SQL Trace for CDS usage
RSRTFind embedded analytics views
Eclipse ADTSearch for CDS definitions
TADIR, DDLSOURCEQuery Metadata Tables
Fiori "View Browser"Find standard & custom views
Custom ABAPList CDS views via SQL

Would you like help identifying specific CDS views for your use case? 🚀

You said:
What exactly CDS View and how it is different from HANA Views
ChatGPT said:

What is a CDS View?

A CDS (Core Data Services) View is an advanced data modeling feature in SAP, primarily used in SAP S/4HANA and SAP BW/4HANA. It allows developers to define semantic, reusable, and optimized data models directly in the ABAP layer. CDS views extend the traditional ABAP Dictionary Views (SE11) and offer powerful features like:
Performance Optimization: Push-down to HANA DB for fast execution.
Annotations: Metadata for UI, security, and OData exposure.
Joins, Associations, Projections: Simplifies data modeling.
Extensibility: Can be enhanced without modifying the original view.

CDS Views are written in DDL (Data Definition Language) and are managed in ABAP Development Tools (ADT) in Eclipse.


Difference Between CDS Views and HANA Views

FeatureCDS ViewHANA View
TechnologyABAP-based (SAP Application Layer)HANA-native (Database Layer)
Definition ToolCreated in Eclipse (ABAP Development Tools - ADT)Created in HANA Studio or Web IDE
LanguageABAP CDS (DDL)HANA SQLScript
ExecutionOptimized for SAP applications (S/4HANA, BW/4HANA)Generic, optimized for all HANA-based apps
SecurityUses SAP Authorization (PFCG, S/4 roles)Uses HANA DB privileges (GRANT/REVOKE)
TransportabilityTransported via SAP Transport Management System (CTS)Transported separately via HANA Transport Container
UsagePreferred for S/4HANA Fiori apps, Embedded Analytics, ABAP ReportsUsed for Native HANA models, external reporting (BW, SAC, Power BI)
ExtensibilityAllows annotations, associations, and enhancementsMore rigid, changes require re-deployment
OData ServicesDirect OData exposure for Fiori/UI5Requires manual OData configuration

When to Use CDS Views vs. HANA Views?

📌 Use CDS Views if:

  • You need tight SAP integration (Fiori, ABAP Reports, Embedded Analytics).
  • You want OData exposure for API or UI5 apps.
  • You need security via SAP roles instead of DB privileges.
  • You prefer extensibility & reusability via CDS annotations.

📌 Use HANA Views if:

  • You require high-performance analytics at the database level.
  • You are working with non-SAP applications needing HANA-native models.
  • You need direct data access outside of SAP (e.g., Power BI, Tableau).
  • You are using SAP BW/4HANA with complex transformations.

Example of a Simple CDS View (ABAP Layer)

sql
@AbapCatalog.sqlViewName: 'ZSALES_CDS' @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Sales Order Data' define view ZSales_Order as select from vbak association [1..1] to vbap as _Items on vbak.vbeln = _Items.vbeln { key vbak.vbeln, // Sales Order vbak.erdat, // Order Date vbak.kunnr, // Customer _Items.matnr, // Material _Items.netpr // Net Price }

This view joins VBAK (Sales Header) and VBAP (Sales Items), making it easy to retrieve sales order data in ABAP programs and Fiori apps.


Example of a HANA View (Database Layer)

sql
CREATE VIEW Sales_View AS SELECT vbak.vbeln, vbak.erdat, vbak.kunnr, vbap.matnr, vbap.netpr FROM sapabap1.vbak AS vbak JOIN sapabap1.vbap AS vbap ON vbak.vbeln = vbap.vbeln;

This HANA view is executed at the database level and is usable across HANA-native reporting tools.


Key Takeaways

CDS Views = ABAP Layer, SAP S/4HANA, Embedded Analytics, Extensibility
HANA Views = Database Layer, High Performance, External Tools, Native HANA Reporting

No comments:

Post a Comment

Fiori Development - Style

Okay, here is a rewritten version incorporating the detailed information about developing preformatted layout reports, including a Table of ...