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
- Step 1TableDatabase
The persistent data lives in a database table.
- Step 2CDS viewData model
Define views and relationships.
CDSCore data services - Step 3BehaviorBDEF
Add actions, validations and determinations.
EMLEntity manipulation - Step 4ServiceDefinition
Choose what to expose.
- Step 5BindingOData
Bind it as an OData V2 or V4 service.
GatewayOData runtime - Step 6UIFiori elements
Annotations drive the user interface.
FioriFront endATCQuality 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
- 0–3 years Junior developer or analystBuilds small changes and fixes defects under guidance.
- 3–7 years Developer or engineerDesigns and delivers features on their own.
- 7–12 years Senior engineer or leadOwns quality, performance and code review for a team.
- 12+ years Technical architectChooses 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.
Key SAP RAP transaction codes
Each linked code opens its own reference page with fields, errors and related objects.
| Tool or transaction | What it does |
|---|---|
| Define view entity | CDS view definition |
| Behavior definition | Describes create, update, delete and actions |
| Service definition | What objects are exposed |
| Service binding | Publishes the OData service |
| Projection view | UI-specific layer of the model |
| EML | Language to read and change entities |
More SAP RAP T-codes
- /IWFND/ERROR_LOG SAP Gateway Error Log
- /IWFND/MAINT_SERVICE Activate and Maintain OData Services
- /IWFND/GW_CLIENT SAP Gateway Client
- /IWBEP/ERROR_LOG SAP Gateway Backend Error Log
- /IWFND/V4_ADMIN OData V4 Service Administration
- /UI2/FLP Start the SAP Fiori Launchpad
- /UI2/FLPD_CUST Fiori Launchpad Designer (Client-Specific)
- /UI5/APP_INDEX_CALCULATE Calculate the SAPUI5 Application Index
- /UI2/INVALIDATE_GLOBAL_CACHES Invalidate Global Launchpad Caches
- /IWFND/TRACES SAP Gateway Performance and Payload Trace
- SEGW SAP Gateway Service Builder
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.CDS Views
- CDS Views Part 1: What a CDS View Entity Is and Why It MattersBeginner · 11 min
- CDS Views Part 2: Create Your First CDS View Entity in ADTBeginner · 11 min
- CDS Views Part 4: Authorization with DCL and Clean-Core Data AccessIntermediate · 11 min
- CDS Views Part 3: Performance — Joins, Associations, Filters and AggregationIntermediate · 10 min
- RAP Custom Entities with IF_RAP_QUERY_PROVIDER: Paging, Filtering and AuthorizationAdvanced · 9 min
2.CDS Associations
- CDS Associations Part 1: Source, Target, ON Condition and CardinalityBeginner · 8 min
- CDS Associations Part 5: Troubleshooting Duplicates, Missing Data and Slow QueriesIntermediate · 8 min
- CDS Associations Part 2: Path Expressions and How Associations Become JoinsIntermediate · 8 min
- CDS Associations Part 4: Associations vs Compositions in a RAP Business ObjectIntermediate · 8 min
- CDS Associations Part 3: To-One vs To-Many — Semantics and PerformanceIntermediate · 8 min
3.CDS Annotations
- CDS Annotations Part 1: What Annotations Are and Where They ApplyBeginner · 9 min
- CDS Annotations Part 3: Fiori UI Annotations — Line Items, Facets and Selection FieldsIntermediate · 11 min
- CDS Annotations Part 4: Metadata Extensions — Separating UI from the Data ModelIntermediate · 9 min
- CDS Annotations Part 2: Semantic Annotations for Currency, Units and TextsIntermediate · 9 min
- CDS Annotations Part 5: Troubleshooting Precedence, Metadata and UI BehaviorIntermediate · 8 min
4.RAP Business Objects
- RAP Business Objects Part 2: Managed vs Unmanaged — A Decision FrameworkIntermediate · 10 min
- RAP Business Objects Part 1: Designing the BO — Root, Children and BoundariesIntermediate · 10 min
- RAP Business Objects Part 3: Transactional Buffer, Save Sequence and the RAP LUWIntermediate · 10 min
- RAP Business Objects Part 4: Locking, ETags and Concurrency ControlIntermediate · 9 min
- RAP Business Objects Part 5: Authorization, Feature Control and MessagesIntermediate · 11 min
5.Behavior Definitions
- Behavior Definitions Part 1: Reading a BDEF as the BO ContractIntermediate · 10 min
- Behavior Definitions Part 3: Actions, Functions, Determinations and ValidationsIntermediate · 10 min
- Behavior Definitions Part 4: Associations, Compositions and Draft DeclarationsIntermediate · 10 min
- Behavior Definitions Part 2: CRUD, Field Control, Numbering, Locking and AuthorizationIntermediate · 10 min
- Behavior Definitions Part 5: Projection Behavior, Strict Mode and Stable ContractsAdvanced · 10 min
6.Behavior Implementations
- Behavior Implementations Part 3: Actions, Results and User-Facing MessagesIntermediate · 12 min
- Behavior Implementations Part 1: The Behavior Pool — Handler and Saver ClassesIntermediate · 12 min
- Behavior Implementations Part 2: Determinations and Validations Without Side EffectsIntermediate · 10 min
- Behavior Implementations Part 4: Save Sequence, Late Numbering and Unmanaged SaveAdvanced · 12 min
- Behavior Implementations Part 5: Performance, Unit Testing and DebuggingAdvanced · 11 min
7.EML
- EML Part 2: %cid, %cid_ref, MAPPED, FAILED and REPORTEDIntermediate · 9 min
- EML Part 1: What EML Is — READ, MODIFY and COMMIT ENTITIESIntermediate · 10 min
- EML Part 3: IN LOCAL MODE — What It Bypasses and When It Is SafeIntermediate · 9 min
- EML Part 4: Cross-BO Calls, COMMIT ENTITIES and ROLLBACK ENTITIESAdvanced · 10 min
- EML Part 5: Testing RAP with EML and Transactional ConsistencyAdvanced · 11 min
8.Managed RAP
- Managed RAP Part 1: Tables, CDS Data Model and Your First Behavior DefinitionBeginner · 22 min
- Managed RAP Part 4: Compositions, Create-by-Association and DraftIntermediate · 16 min
- Managed RAP Part 3: Determinations, Validations, Actions and Feature ControlIntermediate · 21 min
- Managed RAP Part 2: Numbering, Locking, ETags and AuthorizationIntermediate · 14 min
- Managed RAP Part 5: Projection Layer, Testing, Performance and Clean CoreAdvanced · 14 min
9.Draft Handling
- Draft Handling Part 2: Draft Lifecycle — Create, Edit, Resume, Activate, DiscardIntermediate · 9 min
- Draft Handling Part 1: Draft Architecture — Active Data and Draft PersistenceIntermediate · 9 min
- Draft Handling Part 5: Troubleshooting Draft IncidentsAdvanced · 8 min
- Draft Handling Part 4: Validations, Determinations and Side Effects in DraftAdvanced · 9 min
- Draft Handling Part 3: Draft Locking, ETags and ConcurrencyAdvanced · 9 min
10.Service Definitions
- Service Definitions Part 1: What a Service Definition DoesBeginner · 6 min
- Service Definitions Part 2: Exposing Projection Entities as a Business ServiceIntermediate · 6 min
- Service Definitions Part 4: Troubleshooting Activation and Exposure GapsIntermediate · 8 min
- Service Definitions Part 3: API Boundary, Naming and VersioningIntermediate · 7 min
- Service Definitions Part 5: UI vs Integration APIs — Reuse or Separate?Advanced · 8 min
- Service Definitions Part 6: Exposing Multiple Entities and NavigationAdvanced · 8 min
11.Service Bindings
- Service Bindings Part 2: Create, Activate, Publish and Test in ADTBeginner · 11 min
- Service Bindings Part 1: From Business Object to OData ServiceBeginner · 11 min
- Service Bindings Part 6: Preview, $metadata and Fiori Elements AnnotationsIntermediate · 15 min
- Service Bindings Part 3: Moving Bindings Through DEV, QAS and PRDIntermediate · 13 min
- Service Bindings Part 4: UI vs Web API, OData V4 vs V2Intermediate · 11 min
- Service Bindings Part 5: Troubleshooting 404, 403, Metadata and CacheAdvanced · 12 min
12.Fiori Elements
- Fiori Elements Part 1: List Report and Object Page on RAPBeginner · 8 min
- Fiori Elements Part 2: Generate a List Report and Object Page from RAPBeginner · 14 min
- Fiori Elements Part 3: Designing Apps with UI AnnotationsIntermediate · 8 min
- Fiori Elements Part 4: Extending Apps with the Flexible Programming ModelIntermediate · 8 min
- Fiori Elements Part 5: Enterprise Scale — Performance, Draft and Clean CoreAdvanced · 9 min
13.SAPUI5 and SAP Fiori Tools
- SAPUI5 and Fiori Tools Part 1: MVC, Models, Views and ControllersBeginner · 10 min
- SAPUI5 and Fiori Tools Part 2: Set Up BAS or VS Code and Generate an AppBeginner · 9 min
- SAPUI5 and Fiori Tools Part 6: Debugging, Testing and PerformanceIntermediate · 9 min
- SAPUI5 and Fiori Tools Part 4: Routing, Navigation, Fragments and DialogsIntermediate · 10 min
- SAPUI5 and Fiori Tools Part 3: Data Binding — JSON Model, OData Model, ModesIntermediate · 9 min
- SAPUI5 and Fiori Tools Part 7: Deployment to BTP and ABAPIntermediate · 8 min
- SAPUI5 and Fiori Tools Part 5: OData V4 Read, Create, Update and ErrorsIntermediate · 9 min
14.Unmanaged RAP
- Unmanaged RAP Part 1: When to Use It — Locks, Numbering and MessagesIntermediate · 15 min
- Unmanaged RAP Part 2: Architecture — CDS, BDEF and Transactional BufferAdvanced · 14 min
- Unmanaged RAP Part 4: Save Sequence, Transaction Safety and Legacy APIsAdvanced · 15 min
- Unmanaged RAP Part 5: Choosing the Implementation Type and Migrating BOPF/SEGWAdvanced · 13 min
- Unmanaged RAP Part 3: Create, Update, Delete and Read HandlersAdvanced · 17 min
15.OData V4
- OData V4 Part 6: ETags and Optimistic ConcurrencyIntermediate · 8 min
- OData V4 Part 4: Actions, Functions and Batch ProcessingIntermediate · 9 min
- OData V4 Part 5: Troubleshooting HTTP Errors, Metadata and PayloadsIntermediate · 8 min
- OData V4 Part 2: Publishing a RAP Service with an OData V4 BindingIntermediate · 7 min
- OData V4 Part 1: The OData V4 Contract — Metadata, Keys, Navigation, QueriesIntermediate · 8 min
- OData V4 Part 3: Test CRUD Requests, Payloads and ResponsesIntermediate · 12 min
16.ABAP Cloud and Released APIs
- ABAP Cloud Part 6: Language Version, Syntax Restrictions and API ChecksIntermediate · 9 min
- ABAP Cloud Part 4: ATC Readiness — Finding and Fixing Unreleased UsageIntermediate · 6 min
- ABAP Cloud Part 1: Released APIs, ATC and Clean CoreIntermediate · 7 min
- ABAP Cloud Part 7: Released APIs and Release ContractsAdvanced · 7 min
- ABAP Cloud Part 3: Replacing Direct Table and Classic API DependenciesAdvanced · 8 min
- ABAP Cloud Part 5: On-Stack Developer Extension vs BTP Side-by-SideAdvanced · 7 min
- ABAP Cloud Part 2: RAP and ABAP Cloud Architecture for Clean-Core ExtensionsAdvanced · 9 min
17.CDS Table Functions
- CDS Table Functions Part 2: Building a Table Function with an AMDP ImplementationIntermediate · 9 min
- CDS Table Functions Part 1: When You Really Need a Table FunctionIntermediate · 7 min
- CDS Table Functions Part 5: Testing, Clean Core and AlternativesAdvanced · 9 min
- CDS Table Functions Part 4: Performance with HANA Plan AnalysisAdvanced · 8 min
- CDS Table Functions Part 3: Parameters, Client Handling and Session ContextAdvanced · 9 min
18.AMDP
- AMDP Part 3: Procedures, Functions and Table Function ImplementationsIntermediate · 9 min
- AMDP Part 1: SQLScript and Code PushdownIntermediate · 8 min
- AMDP Part 2: Create Your First AMDP MethodIntermediate · 11 min
- AMDP Part 6: AMDP in Clean Core and ABAP CloudAdvanced · 8 min
- AMDP Part 5: Debugging, Testing and Performance AnalysisAdvanced · 8 min
- AMDP Part 4: Parameters, Internal Tables and Client HandlingAdvanced · 9 min
19.OData V2
- OData V2 Part 3: Production Troubleshooting — Gateway Logs and MetadataIntermediate · 8 min
- OData V2 Part 2: Deep Insert, Batch and Navigation DesignIntermediate · 8 min
- OData V2 Part 1: The Classic OData V2 Service ModelIntermediate · 7 min
20.SAP Gateway
- SAP Gateway Part 3: SEGW Model, Registration, Metadata and TransportsIntermediate · 9 min
- SAP Gateway Part 1: Gateway as the ABAP OData RuntimeIntermediate · 8 min
- SAP Gateway Part 2: Frontend, Backend and Request FlowIntermediate · 8 min
- SAP Gateway Part 4: Paging, Filtering, CSRF and AuthorizationAdvanced · 9 min
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