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

Prepare the RAP-Based Travel Service

Prepare a travel service based on the SAP ABAP RESTful Application Programming Model (RAP).

Overview

🎓 beginner 20 min. SAP FioriBeginnerSAP Fiori ElementsSAP Business Technology PlatformSAP BTP ABAP Environment

You will learn

  • βœ”How to generate a RAP service as a preparation for this tutorial
  • βœ”How to publish and test the RAP service using the preview option of the ABAP Development Tools
Unknown U Unknown March 6, 2025
Created by February 17, 2021
Contributors

Prerequisites

Prerequisites

  • You need a trial account for the SAP Business Technology Platform. Follow these instructions in case you need to set up an account: Get a Free Account on SAP BTP Trial.
  • Prepare your SAP Business Technology Platform ABAP Environment: Create an SAP BTP ABAP Environment Trial User – be sure to also check the prerequisites of this linked tutorial which include the installation of the ABAP Development Tools.

Steps

Intro

This tutorial shows how to create an individual RAP-based OData service, which can be used within all the steps of the upcoming chapters of the tutorials presented within the tutorial group.

For more information about the ABAP RESTful Application Programming Model (RAP), especially related to the different CDS view files used in the upcoming chapters, please refer to the documentation pages of Get to Know the ABAP RESTful Application Programming Model.


Step 1 Start the service generator
β€”

This tutorial requires an individual OData service having a unique suffix for each participant. This is necessary due to the fact that, within a specific ABAP cloud back-end system, all the development objects (e.g. packages, data-elements, classes, etc.) are globally available for all trial users who are connected to the same system. Since the creation of such an OData service is not the main part of these tutorials, a service generator is used to quickly create an individual service.

Whenever your unique suffix for creating objects is needed, the object names within this tutorial are named with suffix “######”. For the screenshots taken from a real service, the suffix “000100” was used.

  1. Load the ABAP generator class

    Be sure to have opened the ABAP perspective within the ABAP Development Tools. In case you donΒ΄t see the ABAP perspective icon at the top right of the application (see screenshot below), open the ABAP perspective by Window > Perspective > Open Perspective > Other… and choose the ABAP entry within the list of perspectives. Click Open to confirm the dialog.

    Load generator class
    Load generator class

    Now choose the toolbar action Open ABAP Development Object to open the ABAP class that is needed to generate the service.

    Load generator class
    Load generator class

    The name of the class is ``zdmo_cl_fe_travel_generator`. Select the class and confirm the dialog by choosing OK.

    Load generator class
    Load generator class

  2. Start the generator class

    As soon as the class is loaded within the editor, open the context menu via right mouse click and start the service by choosing Run As > ABAP Application (Console).

    Load generator class
    Load generator class

    The generation of the service may take some time. After the process has finished you will see a console message similar to the message shown in the screenshot below.

    Load generator class
    Load generator class

  3. Assign the new package to your favorite packages

    To keep a better overview of your packages, add them by right clicking on the Favorite Packages container and choosing the Add Package… option.

    Load generator class
    Load generator class

    Enter the name of your package ZFE_TRAVEL_###### shown in the console message in the dialog and confirm by choosing OK.

    Load generator class
    Load generator class

    Now you see the package assigned to your favorite packages.

    Load generator class
    Load generator class

Step 2 Publish the service (Optional)
+
Step 3 Preview the service
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Start the service generator 2. Publish the service (Optional) 3. Preview the service

Learn more →