Skip to content

RAP: Architecture, State & Communication

This page compares RAP (Fiori Elements) with abap2UI5, highlighting their differences in architecture, state handling, developer workflow, and client-server communication patterns.


Architecture Comparison

RAP (Fiori Elements)

  • Backend: CDS Views, Behaviours, OData V4 services.
  • Frontend: UI5 Fiori Elements SPA interprets metadata annotations.
  • Rendering: UI is dynamically built in the browser based on OData metadata.
  • Communication: OData V4 protocol for data & actions.
  • Role of Backend: Supplies data & UI definitions (via annotations).

abap2UI5

  • Backend: ABAP Classes define UI5 XML Views & JSON ViewModels.
  • Frontend: Static UI5 Shell renders backend-provided Views.
  • Rendering: Backend controls UI structure, frontend renders View definition.
  • Communication: Simple HTTP requests (Over-the-Wire).
  • Role of Backend: Full control of UI structure, state, and logic.

State Handling

AspectRAP (Fiori Elements)abap2UI5
State DefinitionHandled via RAP Drafts & Managed TransactionsHandled in ABAP ViewModels
Frontend State ManagementUI5 controls manage transient state (filters, selections)Frontend does not manage state independently
PersistenceDraft data persisted via RAP mechanismsData/state reflected in backend ViewModels
InteractivityClient triggers OData actions, state logic often frontend-drivenEvents sent to backend, state is updated centrally in ABAP

Developer Workflow

AspectRAP (Fiori Elements)abap2UI5
UI DefinitionCDS Annotations, OData V4 metadataABAP Class (XML View & ViewModel)
Frontend ArtifactsUI5 Fiori Elements runtime (deployed app)Static UI5 Shell (no separate frontend deployment)
APIsTyped OData V4 services requiredGeneric HTTP handler, no OData needed
Development ScopeCDS, Behaviours, Annotations, UI5 Fiori ElementsPure ABAP Class-based development
DeploymentBackend artifacts + frontend artifacts transported separatelySingle backend deployment (abapGit, transport request)
ComplexityStructured, multi-layeredSimplified, backend-centric

Client-Server Communication Flow

RAP Flow

  1. Browser loads UI5 Fiori Elements SPA.
  2. Requests OData V4 $metadata to understand data model & UI annotations.
  3. Builds UI dynamically in browser based on metadata.
  4. Fetches data via OData entity requests.
  5. User interactions trigger OData actions (CRUD, navigation, validation).
  6. Backend processes logic, returns OData responses.
  7. Client updates UI state accordingly.
plaintext
Browser (Fiori Elements SPA)
  ├──> OData V4 $metadata Request
  ├──> OData Data Requests
  ├──> UI Rendering from metadata
  └──> OData Calls for user actions (function imports, CRUD)
Backend (RAP Services)
  └──> Processes requests, returns data & actions

abap2UI5 Flow

  • Browser loads static UI5 Shell.
  • Requests XML View & ViewModel from backend (ABAP Class).
  • Frontend renders UI5 controls from provided definitions.
  • User events trigger HTTP requests to backend.
  • Backend processes events, updates ViewModel.
  • Backend returns updated ViewModel.
  • Frontend re-binds UI, updating changed controls.
plaintext
Browser (Static UI5 Shell)
  ├──> HTTP Request: Load View & ViewModel
  ├──> Render UI5 controls from backend definitions
  ├──> User events → Event Request to backend
Backend (ABAP Class)
  └──> Processes events, updates ViewModel, returns changes

Side-by-Side Comparison

AspectRAP (Fiori Elements)abap2UI5
UI RenderingClient builds UI dynamically from metadataFrontend renders backend-defined View
CommunicationOData V4 (metadata, data, actions)Simple HTTP event requests & ViewModel updates
State HandlingMix of frontend & RAP draft mechanismsFully backend-driven ViewModel state
Developer WorkflowCDS Views, Behaviours, OData, UI5 annotationsPure ABAP class development
Frontend ArtifactsRequires UI5 app deploymentStatic UI5 Shell, no per-app deployment
FlexibilityStructured, template-based UI, limited runtime changesFull backend control over UI at runtime
ComplexityHigh: CDS + OData + UI5 coordinationLow: ABAP-only, Over-the-Wire simplicity

Conclusion

Both RAP and abap2UI5 aim to simplify SAP UI development — but follow different paradigms:

  • RAP (Fiori Elements) is ideal for standardized apps with CRUD patterns, leveraging OData and annotations to build structured UIs.
  • abap2UI5 enables more runtime flexibility by controlling UI definitions directly in ABAP, reducing frontend complexity and deployment overhead.

For projects where rapid development, backend-driven UI control, and simplified architecture are key, abap2UI5 offers a pragmatic alternative to the more SPA-centric RAP approach.