ERPClimb logoERPClimb
— SAP RAP / CDS / OData

SAP RAP / CDS / OData Tutorial: Beginner to Advanced

105 lessons across 20 topics. Each lesson explains the concept, then shows a real project scenario, the mistakes to avoid and how it comes up in interviews. Work through the topics in order, or jump to the one you need.

The path has 105 lessons by level: 12 beginner, 64 intermediate, 29 advanced. Listed reading time adds up to about 1,033 minutes, so the lessons can be taken in short sessions. Each topic below links to its own topic page, and every lesson shows its level and reading time beside the title.

What is SAP RAP (RESTful Application Programming Model)?

RAP is the modern way to build apps in ABAP. You define data with CDS, add behaviour, and expose it as an OData service for Fiori.

A real situation. A team needs a new "manage orders" Fiori app. They model the data in CDS, add create and update logic in a behaviour definition, and publish an OData service the app calls.

Model

CDS views describe the data and associations.

Behave

Behaviour definitions add create, update, delete and validations.

Expose

Service definitions and bindings publish OData for Fiori and APIs.

The main parts of SAP RAP

  • CDS view entities. Data model and associations.
  • Behavior definitions. Create, update, delete, actions and draft.
  • Behavior implementation. ABAP classes for validations and determinations.
  • Service definition and binding. What is exposed and as which protocol.
  • Fiori elements. Annotations that generate the UI.
  • Testing. ABAP Unit and service tests.

A worked example. A team needs a manage-orders app. They define a CDS view, add a behavior definition with a validation, expose an OData V4 service and let Fiori elements render the list and object page.

What you need first. Basic ABAP and an idea of OData.

CDS: the data model

A CDS view entity defines a view on database tables with fields, joins and associations to other views. Associations describe how entities relate without writing the join each time. Annotations add meaning such as labels and UI hints. CDS runs on the database, which is why it is both clean and fast.

RAP: adding behaviour

A behavior definition says which operations an entity supports: create, update, delete and custom actions. Validations check data before saving, determinations fill or change fields, and draft handling lets a user save unfinished work. The logic is written in ABAP classes called behavior implementations.

Exposing the service

A service definition lists the entities to expose and a service binding publishes them as an OData service, usually V4 for new apps. Fiori elements then builds the user interface from annotations, so a list report and object page need little UI code. Typical problems are an unreleased API in ABAP Cloud, a missing authorisation check and annotations that are in the wrong layer.

SAP RAP process flow and how it connects

The main flow runs through the middle. Above it is where the work lives. Below it are the other modules and systems that touch each step.

Where it runs

  • ABAP Cloud · Language
  • ADT · Eclipse editor
  • Transport · Change control
  • Runtime · Gateway
  1. Step 1
    Table
    Database

    The persistent data lives in a database table.

  2. Step 2
    CDS view
    Data model

    Define views and relationships.

    CDS
    Core data services
  3. Step 3
    Behavior
    BDEF

    Add actions, validations and determinations.

    EML
    Entity manipulation
  4. Step 4
    Service
    Definition

    Choose what to expose.

  5. Step 5
    Binding
    OData

    Bind it as an OData V2 or V4 service.

    Gateway
    OData runtime
  6. Step 6
    UI
    Fiori elements

    Annotations drive the user interface.

    Fiori
    Front end
    ATC
    Quality checks

Teal marks steps that post to or are owned by finance or another module. Amber marks where the work is organised.

The flow in words: 1. Table → 2. CDS view → 3. Behavior → 4. Service → 5. Binding → 6. UI.

SAP RAP consultant roles and responsibilities

On an implementation

Models data and behaviour, builds services and reviews them.

In support

Fixes service, annotation and performance problems.

A typical week

  • Model CDS views and annotations.
  • Write behaviour classes.
  • Test OData services.
  • Fix performance of CDS queries.
  • Review code with ATC.

Career ladder

  1. 0–3 years Junior developer or analyst
    Builds small changes and fixes defects under guidance.
  2. 3–7 years Developer or engineer
    Designs and delivers features on their own.
  3. 7–12 years Senior engineer or lead
    Owns quality, performance and code review for a team.
  4. 12+ years Technical architect
    Chooses the approach across systems and sets standards.

Problems you will meet in tickets

  • Behaviour implementation not called
  • OData service returns 404
  • Annotation not showing in UI
  • Draft handling error
  • Authorization check missing

Mistakes beginners make

  • Putting UI annotations in the base view.
  • Skipping draft when users need it.
  • Using released APIs wrongly in ABAP Cloud.
  • Not testing authorisations.

Paste a real error to get a diagnosis

Key SAP RAP transaction codes

Each linked code opens its own reference page with fields, errors and related objects.

Tool or transactionWhat it does
Define view entityCDS view definition
Behavior definitionDescribes create, update, delete and actions
Service definitionWhat objects are exposed
Service bindingPublishes the OData service
Projection viewUI-specific layer of the model
EMLLanguage to read and change entities

More SAP RAP T-codes

Browse every SAP RAP / CDS / OData T-code, table and error in the library

Classic vs Modern: what changed for SAP RAP

Older approach

Classic. BOPF and SEGW for services.

Modern. RAP is the standard for new apps.

Language

Classic. Full ABAP.

Modern. ABAP Cloud limits to released APIs.

UI

Classic. Custom UI5 code.

Modern. Fiori elements generated from annotations.

How to study SAP RAP: the lesson path

Work through the topics below in order. Each one opens its topic page with the lessons from beginner to advanced.

  1. 1.CDS Views

  2. 2.CDS Associations

  3. 3.CDS Annotations

  4. 4.RAP Business Objects

  5. 5.Behavior Definitions

  6. 6.Behavior Implementations

  7. 7.EML

  8. 8.Managed RAP

  9. 9.Draft Handling

  10. 10.Service Definitions

  11. 11.Service Bindings

  12. 12.Fiori Elements

  13. 13.SAPUI5 and SAP Fiori Tools

  14. 14.Unmanaged RAP

  15. 15.OData V4

  16. 16.ABAP Cloud and Released APIs

  17. 17.CDS Table Functions

  18. 18.AMDP

  19. 19.OData V2

  20. 20.SAP Gateway

SAP RAP questions people ask

What is SAP RAP?

The RESTful Application Programming model is SAP's framework for building transactional apps and services in ABAP.

Do I need RAP to build Fiori apps?

Not always, but RAP is the recommended path for new apps on S/4HANA and BTP ABAP.

What is a CDS view?

A view defined in ABAP that describes data and relationships and is executed on the database.

What does an RAP developer do?

Builds data models, behaviour and services and tests them with Fiori.

What should I learn before RAP?

Basic ABAP, then CDS, then RAP behaviour definitions.

Preparing for interviews? SAP RAP / CDS / OData interview questions · All SAP tracks