[go: up one dir, main page]

0% found this document useful (0 votes)
15 views9 pages

RESTful ABAP Programming Model (RAP)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views9 pages

RESTful ABAP Programming Model (RAP)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

RESTful ABAP Programming Model

RAP
RESTful ABAP Programming Model (RAP) – Read only Report:
A read-only report means the app can show data from SAP tables/views but does not allow
create, update, or delete actions.

RAP Architecture
1. Data Model → CDS Views

• Basic View – Raw data, no logic.

• Composite View – Joins and business logic (e.g., sums, calculations).

• Consumption View – Final view for UI, fields only, no logic.

• Metadata Extension – UI annotations (which fields are visible/searchable).

2. Service Exposure –> OData UI

• Service Definition – Select the CDS view(s) you want to expose.

• Service Binding – Publish as OData service so Fiori can consume it.

3. Service Consumption -> Fiori

• Fiori UI – The OData service is used in a Fiori app (list, report, etc.).

Step-by-step RAP report using Purchase Order header and item data.

Basic View — create a simple copy of tables


A view that just exposes fields from PO Header / PO Item. No calculations.
Keep a clean base layer. If table/view name changes, only this layer maps it.

Do this in Eclipse (ADT):

Open Eclipse → File → New → Others.

Search for Data Definition → Click Next.


Enter Name, Description → Next.

Select Define View Entity → Finish.

Add fields

Activate.

Composite View — join and add business logic


Should be built on top of Basic View.

Add calculations (e.g., total net value).


All calculations and aggregations should live here so UI stays simple.

Open Eclipse → File → New → Others.


Search for Data Definition → Click Next.

Enter Name, Description → Next.

Select Define View Entity → Finish.


Activate.

Consumption View — shape data for the UI


Pick only fields the front-end needs. No new calculations here.
Keeps the UI fast and only shows required data.

Do in Eclipse:

Open Eclipse → File → New → Others.

Search for Data Definition → Click Next.

Enter Name, Description → Next.

Select Define View Entity → Finish.


Metadata Extension — add UI annotations
Tell Fiori which columns to show, which fields are filters, which are mandatory inputs.
Controls the layout of the Fiori list / filter bar without changing data logic.

Do in Eclipse:
Open Eclipse → File → New → Others.

Search for Metadata Extension → Click Next.


Enter Name, Description → Next.

Select Annotate Entity→ Finish.

Service Definition — expose the consumption view


Tell the system which views become OData entities/Exposed to frontend.
Do in Eclipse:

Create a Service Definition on top of Consumption View.

Right-click Consumption View → New Service Definition


Add the consumption view.

Service Binding — publish OData (OData V4 - UI)


Bind your service to an OData so UIs and frontend can call it.

Do in Eclipse:

Create a Service Binding for your Service Definition.

Right-click Service Definition → New Service Binding.

Choose OData V4 – UI as the type.


Publish the service.

Testing the app


Use the Preview from Service Binding to see the list.

You might also like