Defining Services

Objective

After completing this lesson, you will be able to Create service entities.

Define Services

Business Scenario

Your company is planning to develop a set of cloud-based applications based on the SAP Cloud Application Programming Model (CAP), and these applications will be deployed to the SAP Business Technology Platform (BTP) as extension applications for the SAP core back end systems.

In this exercise, you will perform the following task: create service entities.

Now, you will create service entities for Risks and Mitigations, to define which parts of the data models you created are exposed to the application.

Note

Note that some of the services that this learning journey links to, can incur costs.

If you are concerned about charges, you can opt to skip the corresponding exercises and watch the simulation instead.

Exercise Options

You can perform this exercise in two ways:

  1. Live Environment / Practice System: you can perform the steps provided below, either in your SAP BTP account or you use the "Practice System Access" provided below.
  2. Simulation: follow the step-by-step instructions within the simulation.

Note

You can try out this exercise in the practice system below. Open the system by choosing the button at the end of this page.

Note that the practice system access only covers access to the SAP Business Application Studio. When deploying to an SAP BTP runtime or consuming other SAP BTP services, you have to use an SAP BTP Trial Account, Free-Tier, or an Enterprise Account.

Note

We recommend performing the steps in the live environment first.

The following simulation reproduces the full exercise execution:

Task 1: Create Services

Steps

  1. Create a new service.

    1. Go back to the Storyboard.

    2. Find the Services tile.

    3. Choose the entry corresponding to the namespace you created before, for example RiskManagementService. From the menu that open select Add Service Entity.

      The service.cds screen opens

    4. Make sure Enable Draft editing is selected. Select RiskManagement.Risks as type for this projection and save your changes.

    5. Check, that a new entity displays in the service.cds tab.

  2. Check that the service is set to draft editing.

    A draft is a temporary version of a business entity that has not yet been explicitly saved as an active version. Drafts are used:

    • To keep unsaved changes if an editing activity is interrupted, allowing users to resume editing later.
    • To prevent data loss if an app terminates unexpectedly.
    • As a locking mechanism to prevent multiple users from editing the same object at the same time, and to make users aware when there are unsaved changes by another user.
    1. Select the Risks entity in the service.cds tab.

    2. Choose the entity’s header. Choose the Show Details.

      This allows to add properties to it.

      A menu displays on the right side of the screen.

    3. Choose the Settings tab. Check the Draft Editing checkbox is selected.

  3. Configure a new entity.

    1. Choose Add Entity, back in service.cds tab.

      A new entity displays.

    2. Drop this new entity somewhere on the service.cds tab.

      The Projection section opens on the right.

    3. Make sure Enable Draft editing is selected. Select RiskManagement.Mitigations as type for this projection and save your changes.

    4. Check, that a new entity displays in the service.cds tab.

  4. Check that the service is set to draft editing.

    1. In the service.cds tab, select the Mitigations entity by double-clicking on its name.

      Note, that the properties for Mitigations now display in the menu on the right side.

    2. If you don’t see the details menu on the right, choose the entity’s header and choose the Show Details icon.

    3. Find the Settings tab in the menu on the right side. Check the Draft Editing checkbox is selected.

Log in to track your progress & complete quizzes