ERPClimb logoERPClimb
CDS Views
RAP / CDS / ODataadvanced 9 min read

RAP Custom Entities with IF_RAP_QUERY_PROVIDER: Paging, Filtering and Authorization

Preview · a free account unlocks the full lesson

Key takeaway

Implement a controlled read-only query over an external or computed data source using the RAP query provider contract. A RAP custom entity has no managed database persistence by itself; a query provider supplies result rows on demand. It is useful for a computed or remote read model when a normal CDS view entity does not fit. Pagina

Visual overview

RAP custom query provider — learning sheetERPClimb original flow training diagram: Never fetch unauthorized records and silently ignore unsupported filters. Illustrative SAP process, not a product screenshot.ERPCLIMB · PROCESS FLOWILLUSTRATIVE · CHECK SAP EDITIONRAP custom query provider01OData filter + sortStatus=OPEN02Query provider methodTop=20, skip=2003Authorized backend dataStable sort by key04Page + count responseNever fetch unauthorized records and silently ignore unsupported filters.

Explanation

DIRECT ANSWER

Implement a controlled read-only query over an external or computed data source using the RAP query provider contract.

WHAT SAP DOES AND WHAT IT DOES NOT DO

A RAP custom entity has no managed database persistence by itself; a query provider supplies result rows on demand. It is useful for a computed or remote read model when a normal CDS view entity does not fit. Pagination, filters, sorting, total counts and authorization cannot be left to the default accidental behavior of the source API.

PREREQUISITES / PRODUCT EDITION

This is an original synthetic training scenario, not a customer screenshot. Before editing any configuration, verify product edition, relevant scope/entitlements, existing customizing, authorization, business owners and transport approval. Classic SAP GUI transactions are not always available in S/4HANA Cloud Public Edition or restricted ABAP Cloud. Work in an authorized sandbox; protect customer data.

STEP-BY-STEP IMPLEMENTATION AND EVIDENCE

STEP 1 — Scope

Define the response contract for a small ticket-health list: TicketID, Owner, Status and ChangedAt. Decide stable keys and which status filters/sort orders the OData service must expose. Confirm that the underlying remote API can supply these fields without leaking unauthorized tickets.

STEP 2 — Configure

Create the CDS custom entity using the annotations and query implementation class required by the target ABAP Platform and language version. Implement the supported IF_RAP_QUERY_PROVIDER request/response workflow; do not paste public-cloud-incompatible ABAP APIs into a restricted language version.

STEP 3 — Run

Read the requested filter conditions, selected fields, sort elements and page limit/offset through the interface. Translate only supported predicates to the backend call; reject or safely handle unsupported filters instead of retrieving every record and silently ignoring the client query.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.