Skip to content
Tutorials Center
My learning

Topics

Lesson 32 of 36 ยท S/4HANA and Careers

S/4HANA Data Models: CDS, Fiori and HANA

Learn the modern SAP stack: HANA column store and code pushdown, Core Data Services (CDS) views, OData services, the Fiori launchpad and the RAP programming model.

Modern SAP development does not look like the SAP GUI screens of the nineties. The user interface is SAP Fiori in the browser, data is modelled with Core Data Services (CDS) views, and the work is pushed to the HANA database. This lesson explains how these three layers fit together, so that you can read a modern SAP architecture diagram and follow how a tile on the launchpad ends up reading a table.

SAP cannot run on this site, so listings are read-only, and the runnable JavaScript blocks are stand-ins for the ideas.

HANA in one page

SAP HANA is an in-memory, column-oriented database. Instead of storing each row together (good for fetching one record), a column store keeps each column together. For analytics ("sum of net value by region") the database reads only the needed columns, compresses them heavily and processes them in parallel in memory.

This enables code pushdown: instead of reading a million rows into ABAP and adding them up there, the program asks the database to sum them, and only the result travels. Compare with the performance rules in Open SQL: Reading the Database. Pushdown techniques include Open SQL aggregates, CDS views and AMDP (ABAP-managed database procedures written in SQLScript).

CDS views

A CDS view is a data model defined in a text file, with annotations. The database creates the view; ABAP and UIs read it like a table.

TEXT
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales order items with net value'
define view entity ZI_SalesOrderItem
  as select from vbap as Item
    inner join   vbak as Header on Header.vbeln = Item.vbeln
{
  key Item.vbeln as SalesOrder,
  key Item.posnr as Item,
      Header.kunnr as Customer,
      @Semantics.amount.currencyCode: 'Currency'
      Item.netwr   as NetValue,
      Item.waerk   as Currency
}

Things to notice:

  • define view entity is the modern form (replacing older DDIC-based CDS views).
  • Annotations (@...) describe semantics, authorization checks and UI behavior.
  • Associations (association [0..1] to I_Customer as _Customer on ...) are lazy joins, resolved only when a consumer follows them.
  • Access control is defined separately with a DCL (Data Control Language) object, tying into the authorization concept in Users, Roles and Authorizations.
  • SAP delivers thousands of ready CDS views, called the virtual data model (VDM), with prefixes like I_ (interface views, stable) and C_ (consumption views).
JS Stand-in: a CDS-like view over two tables

Press Run (or Ctrl + Enter) to see the console output here.

No output.

OData services

A CDS view is exposed to the outside as an OData service (a REST-style standard with $filter, $select, $orderby, $top). Fiori apps talk only OData. You publish a service binding in ADT and test it at /sap/opu/odata4/... or with the gateway client (/IWFND/GW_CLIENT). An example request looks like this:

TEXT
GET /sap/opu/odata4/sap/zui_salesorder/srvd/sap/zui_salesorder/0001/SalesOrderItem
    ?$filter=Customer eq 'C1'&$select=SalesOrder,NetValue&$top=10
JS Stand-in: applying OData query options

Press Run (or Ctrl + Enter) to see the console output here.

No output.

SAP Fiori

Fiori is SAP's design system and the set of apps built with it, based on SAPUI5 (an HTML5/JavaScript framework, open-sourced as OpenUI5). Users start at the Fiori launchpad, a page of tiles (each starts an app) grouped into spaces and pages. Roles determine which tiles appear, which means authorizations again define the experience.

App types:

  • Transactional apps: create or change business objects (for example "Manage Sales Orders").
  • Analytical apps and tiles: KPIs and charts built on CDS views (embedded analytics).
  • Fact sheets: read-only overview of one object with navigation to related ones.

Fiori elements generates the UI from annotations on CDS views (list report, object page), so many apps need no hand-written UI code. Custom UI uses freestyle SAPUI5.

RAP: the modern programming model

The ABAP RESTful Application Programming Model (RAP) ties it together. You define the data model in CDS, a behavior definition with create/update/delete actions, validations and determinations written in ABAP classes, and a service definition and binding that exposes it as OData. Draft handling, authorization and transactional safety come from the framework.

flowchart TD
  T["Database tables"] --> C["CDS view entities"]
  C --> B["Behavior definition<br/>+ ABAP behavior class"]
  B --> S["Service definition + binding<br/>(OData V4)"]
  S --> F["Fiori elements app<br/>on the launchpad"]

The same layers appear in every RAP application, from the database up to the tile.

Other parts of the stack

  • SAP BTP (Business Technology Platform): SAP's cloud platform for extensions, integration (SAP Integration Suite) and analytics (SAP Analytics Cloud).
  • ABAP Cloud: the restricted, upgrade-stable ABAP language version that allows only released APIs.
  • Embedded analytics: KPI tiles and reports on CDS views inside S/4HANA.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is a column store good at?

    Reading only the needed columns, compressed and in parallel, suits analytics.
  2. 2. What is a CDS view?

    CDS views define reusable, annotated data models on top of tables.
  3. 3. Which protocol do Fiori apps use to talk to the backend?

    Fiori apps consume OData services (REST style).
  4. 4. What does Fiori elements generate?

    Floorplans like the list report are generated from annotations.

Summary

  • HANA's in-memory column store enables code pushdown.
  • CDS views model data with annotations, associations and access control.
  • OData exposes views to Fiori apps; the launchpad shows role-based tiles.
  • RAP combines CDS, behavior and service binding in a consistent model.
  • BTP and ABAP Cloud support the clean-core approach.

Next: SAP Careers and Certifications