βš™οΈSAPTools
πŸ“š

SAP RAP Quick Reference

ABAPNew

Complete quick reference for SAP Restful ABAP Programming (RAP). Covers behavior definitions, projections, determinations, validations, actions, and draft handling with code examples.

RAP Architecture Layers

RAP (RESTful Application Programming Model) is built on three layers: CDS data model, behavior definition, and service projection.

" Layer 1: CDS Interface View (I_)
define root view entity ZI_SalesOrder
  as select from zsales_order
  ...

" Layer 2: Behavior Definition (BDEF)
managed implementation in class zbp_i_salesorder unique;
  ...

" Layer 3: Service Definition + Binding
define service ZUI_SalesOrder_O2 {
  expose ZC_SalesOrder as SalesOrder;
}

Behavior Definition Types

Choose the right behavior type based on where business logic lives.

" Managed: SAP handles CRUD automatically
managed implementation in class zbp_i_salesorder unique;

" Unmanaged: You implement all CRUD in your class
unmanaged implementation in class zbp_i_salesorder unique;

" Abstract: For reuse scenarios (no direct transactional use)
abstract;

" Projection: Restricts a managed behavior for a UI scenario
projection;

Advertisement

About SAP RAP Quick Reference

RAP (RESTful ABAP Programming) introduces a lot of new vocabulary at once β€” behavior definitions, projections, determinations, validations, actions, draft handling β€” and the official documentation is spread across many separate guides. This quick reference condenses the core RAP concepts into one page with code examples for each, useful as a refresher while building your first managed or unmanaged RAP business object.

How to use this tool

  1. Browse RAP concepts by topic: behavior definitions, projections, determinations, validations, actions, draft handling.
  2. Read the code example for each concept to see the exact syntax expected in a .bdef file.
  3. Use it as a checklist while scaffolding a new RAP business object, to make sure you haven't skipped a required determination or validation.
  4. Cross-reference with the CDS View Generator and CDS Domain Visualizer on this site when modeling the underlying data.

All processing happens locally in your browser. No data is sent to any server. Your SAP code and business data remain private at all times.

Frequently Asked Questions

What is SAP RAP?

SAP Restful ABAP Programming (RAP) is the modern framework for building SAP Fiori apps and OData services on SAP S/4HANA and BTP ABAP Environment. It replaces the legacy CDS + Gateway approach with a unified, annotation-driven model with built-in draft handling.

What are the main layers of a RAP business object?

A RAP BO has: (1) Base CDS views (data model), (2) Behavior Definition (BDEF) defining create/update/delete capabilities and custom actions, (3) Behavior Implementation class (ABAP class with handler methods), and (4) Projection CDS views + Projection BDEF for the service exposure.

What is RAP draft handling?

Draft handling allows users to save incomplete data temporarily without activating it. RAP generates draft tables automatically when you add "with draft;" to the BDEF. Users can resume editing later, and the Fiori UI shows draft indicators. It is controlled by @Draft.enabled: true annotations.