Techbite Series: ABAP Core Data Services - Part 1

Jun 24, 2024

Techbite Series: ABAP Core Data Services

Part 1: Overview and Basics

Introduction

  • Presenters: Developer Advocate Sheena and another speaker.
  • Focus: Overview and basics of ABAP Core Data Services (ABAP CDS).
  • ABAP CDS central for SAP BTP ABAP environment and S4/HANA (cloud and on-premises).
  • Important for building apps, services, extensions for SAP products.

Key Points

ABAP Core Data Services (CDS)

  • Purpose: Advanced infrastructure for defining and consuming semantically rich data models on ABAP stack.
  • *Model Types Supported:
    • Transactional applications.
    • Analytical applications.
    • Enterprise search models.
  • *CDS Entities:
    • Main building blocks of ABAP data models.
    • Supported by CDS data types and functions.

Benefits

  • Performance Boost: Reduced execution time by pushing calculations to the data layer, minimizing communication cost between application and database layers.
  • Security: CDS Access Control for role-based authorization.
  • Service Consumption: Service definition and binding for publishing data models as business services (e.g., OData service for Fiori, INA service for analytics, SQL service for ODBC clients).
  • Extensibility: Extend data models using defined extension points at various levels.

ABAP Data Models

  • Introduction: Introduced with SAP NetWeaver AS ABAP 7.40 with SAP HANA support; features have grown since.
  • *Elements:
    • CDS View Entities: Building blocks for data models.
    • Associations: Define relationships between entities, simplify query construction.
    • Annotations: Enrich views, domain-specific applications (e.g., transactional, analytical, search) using the same data model.
    • CDS Roles: Declarative access control using CDS DCL.
    • Tools: Use ABAP Development Tools (ADT) in Eclipse for creating, managing, and troubleshooting CDS views.
    • Standard V/S Advanced Views: Examples include standard views (CDS View Entities) and advanced views (Custom Entities, Table Functions).

Classical vs. CDS Approach

  • Classical: Intensive calculations in the application layer, resulting in heavy data transfer and performance issues.
  • CDS Approach: Push calculations to the data layer, reducing execution time and enhancing performance.

Key Capabilities

  • Built-in Functions: SQL features like joins, built-in functions (e.g., case, aggregations, arithmetic, string conversions).
  • Associations: Simplify data relationships, reduce explicit joins.
  • Extensibility: Nested views and simple field extensions.
  • Access Control: Declarative control with CDS DCL.
  • Development Tools: ADT in Eclipse provides various features for efficient CDS view development.

Demo Highlights

  • *CDS View Creation:
    • Used DMO_FLIGHT as reference to create new data definition.
    • Demonstrated adding associations and annotations.
    • Showcased built-in functions such as CONCAT, CASE, CAST, and currency conversion.
  • *CDS Projection View:
    • Created projection view using existing view with provider contract.
    • Added UI and filter annotations.
    • Activated and previewed data in Fiori elements app.
  • *Service Definition and Binding:
    • Created service definition to expose projection view as OData V4 service.
    • Published and previewed service.

Conclusion

  • *Key Takeaways:
    • Importance of code push down to the database layer for performance.
    • CDS role in the ABAP restful application programming model.
    • Practical demonstration of CDS views and services.
  • Upcoming sessions will cover more capabilities of ABAP CDS.