SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Implement a Custom Entity and API Execution (Query Implementation) Class

In the SAP Business Technology Platform, ABAP Environment, implement a CDS custom entity and query implementation class; then display the output in a Fiori Elements preview

Overview

🎓 intermediate 30 min. ABAP DevelopmentIntermediateSAP BTP ABAP EnvironmentSAP Business Technology PlatformABAP Connectivity

You will learn

Julie Plummer J Julie Plummer July 16, 2025
Created by March 9, 2023
Contributors

Prerequisites

Prerequisites

  • IMPORTANT: This tutorial cannot be completed on a trial account
  • IMPORTANT: This tutorial is part of a mission. You must complete the previous parts first; otherwise, you may experience errors or unexpected behavior. The link to the mission is available at the top right of the screen, immediately above the list of steps

Steps

Step 1 Add query provider interface to class

You have already tested the connection by displaying data in an ABAP Console app. You will now display this data in a Fiori Elements preview, using a custom entity.

  1. First, open the class ZCL_PROXY_TRAVELS_### and add the interface IF_RAP_QUERY_PROVIDER to the class definition.

    ABAP
    INTERFACES:   if_oo_adt_classrun,
                  if_rap_query_provider.

    The signature of the method IF_RAP_QUERY_PROVIDER~SELECT contains the import parameter io_request. This parameter represents the OData query options that are delegated from the UI and used as input for the SELECT method. Whenever the OData client requests data, the query implementation class must return the data that matches the request, or throw an exception if the request cannot be fulfilled.

  2. You will get a warning: “Implementation missing for method IF_RAP_QUERY_PROVIDER~SELECT.” Select the warning and choose Quick Fix (Ctrl+1) from the context menu. Then choose the fix Add implementation for select.

    An empty method implementation is added.

  3. Format, save, and activate ( Sh+F1, Ctrl+S, Ctrl+F3 ) your class.

Step 2 Specify class in your custom entity
+
Step 3 Implement SELECT method in query implementation class
+
Step 4 Check the code for your query implementation class
+
Step 5 Create service definition
+
Step 6 Create service binding
+
Step 7 Check the code for your custom entity
+
Step 8 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 8
1. Add query provider interface to class 2. Specify class in your custom entity 3. Implement SELECT method in query implementation class 4. Check the code for your query implementation class 5. Create service definition 6. Create service binding 7. Check the code for your custom entity 8. Test yourself

Learn more →