In what ways does a RAP business object take advantage of the SAP HANA database underneath it?
Say your answer out loud first.
Practise another way
Mostly through CDS. The read side of a RAP service is CDS. So the OData query, with its filters, sorting, paging and search, becomes SQL that HANA executes instead of ABAP loops over rows.
Associations are joined only when the request needs them, and CDS access control is added to the same SQL. Heavy logic can go into CDS functions or a table function. On the write side, handlers should be set-based, because they receive whole tables of instances.
The read path is pushed down. The RAP runtime (the orchestration framework, also known as SADL) maps an OData request to a RAP request. Read requests go to the query implementation, which for a normal BO is the CDS projection view.
SADL reads CDS entities with ABAP SQL, so $filter, $orderby, $top/$skip, $search and $count end up as one SQL statement executed in HANA rather than in ABAP.
What CDS adds on top
- Associations on demand: a path to customer or agency is joined only when a requested field needs it.
- Access control: ABAP SQL evaluates CDS roles (DCL) implicitly, so the authorization filter runs inside the same statement.
- Expressions in the database:
case, built-in functions, currency and unit conversion, aggregations for analytical lists. - Table functions (AMDP): when CDS cannot express the logic, a table function runs SQLScript in HANA and can be the data source of a view.
The write path is transactional, so design it well
- Handlers receive tables of keys or entities. Read once with
READ ENTITIES ... IN LOCAL MODE, collect the distinct master-data keys, select them in one statement, then loop in memory.
DATA(customers) = CORRESPONDING tt_customer( travels DISCARDING DUPLICATES
MAPPING customer_id = CustomerID EXCEPT * ).
SELECT FROM zcustomer FIELDS customer_id
FOR ALL ENTRIES IN @customers
WHERE customer_id = @customers-customer_id
INTO TABLE @DATA(valid_customers).
- Database writes happen only in the late save phase, as one database transaction for the whole buffer.
- Draft data lives in draft tables in HANA, so a user's half-finished work survives without an ABAP session.
What is not pushed down
- Virtual elements are calculated in ABAP after the read, so the database cannot filter or sort on them.
- Unmanaged queries (custom entities) are your own ABAP code: paging and filtering are only as good as you implement them.
- Loops with SELECT SINGLE inside a validation undo all of the above.
How to prove it: run the app with an SQL trace (ST05) and check that one list request produces a few large statements, not hundreds of small ones.
Explains how the CDS-based read path turns the OData query into SQL executed in HANA, names concrete pushdown features, and covers set-based handlers and what is not pushed down.
Talks only about 'in-memory and columnar' marketing, or claims the behavior pool code runs in HANA.
Saying RAP 'runs on HANA so it is fast'. Only the CDS read path is pushed down; handler code is ABAP and is as slow as a SELECT in a loop makes it.
- Why can a virtual element not be used for sorting?
- When would you use a CDS table function in a RAP data model?
- How do you find a slow validation in a mass upload?
1 candidate write-up, 3 official pages and 1 technical reference. Confidence: medium. Checked 1 Dec 2026.
- Candidate write-up Gives the question.
- Technical reference Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.