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

Enhance the Business Object Data Model and Enable OData Streams

Enhance the business object data model and enable OData streams with SAP BTP ABAP environment.

Overview

🎓 beginner 15 min. SAP BTP ABAP EnvironmentBeginnerABAP DevelopmentSAP Business Technology Platform

You will learn

  • How to enhance base business object data model
  • How to enhance projected business object data model
  • How to enhance metadata extension to adjust UI semantics
  • How to preview and test enhanced travel app In the previous exercise, you’ve created a database table for storing Travel data and generated your UI service - comprising the business object (BO) entity Travel - on top of it. In this exercise, you will enhance the base BO data model as well as the projected BO data model and its metadata extension, and test the enhanced Fiori elements Travel app. These enhancements will include the definition of new associations, elements, view annotations, and element annotations.
Merve Temel M Merve Temel May 23, 2024
Created by March 9, 2023
Contributors

Prerequisites

Prerequisites

  • You need to have access to an SAP BTP, ABAP environment, or SAP S/4HANA Cloud, ABAP environment or SAP S/4HANA (release 2022 or higher) system. For example, you can create free trial user on SAP BTP, ABAP environment.
  • You have downloaded and installed the [latest ABAP Development Tools (ADT)] (https://tools.hana.ondemand.com/#abap) on the latest Eclipse© platform.
  • You have created an ABAP Cloud Project.
  • Make sure, your system has the ABAP flight reference scenario. If your system hasn’t this scenario. You can download it here. The trial systems have the flight scenario included.

Steps

Intro

Reminder: Do not forget to replace the suffix placeholder ### with your chosen or assigned group ID in the exercise steps below.

Step 1 Enhance base business object data model

Define and expose new associations in the base BO data model defined in the CDS view entity ZRAP100_R_TRAVELTP_###:

  • Associations to the business entities /DMO/I_Customer and /DMO/I_Agency
  • Associations to the value help views I_Currency and /DMO/I_Overall_Status_VH
  1. Define the new associations _Agency, _Customer, _OverallStatus, and _Currency. Open your data definition

    datadefinition
    datadefinition
    ZRAP100_R_TRAVELTP_### and insert the following code snippet after the select statement as shown on the screenshot below. Format the source code with Pretty Printer (Shift+F1).

  2. Replace your code:

```ABAP
association [0..1] to /DMO/I_Agency            as _Agency        on $projection.AgencyID = _Agency.AgencyID
association [0..1] to /DMO/I_Customer          as _Customer      on $projection.CustomerID = _Customer.CustomerID
association [1..1] to /DMO/I_Overall_Status_VH as _OverallStatus on $projection.OverallStatus = _OverallStatus.OverallStatus
association [0..1] to I_Currency               as _Currency      on $projection.CurrencyCode = _Currency.Currency
```

Your source code should look like this: 

  ![association](https://raw.githubusercontent.com/sap-tutorials/abap-core-development/main/tutorials/abap-environment-rap100-enhance-data-model/association.png)
  1. Expose the defined associations _Agency, _Customer, _OverallStatus and _Currency in the selection list. For that, insert the code snippet provided below in the selection list between the curly brackets ({...}) as shown on the screenshot.
```ABAP
,
//public associations
_Customer,
_Agency,
_OverallStatus,
_Currency
```

 ![association](https://raw.githubusercontent.com/sap-tutorials/abap-core-development/main/tutorials/abap-environment-rap100-enhance-data-model/association2.png)
  1. Save
    save icon
    save icon
    and activate
    activate icon
    activate icon
    the changes.
Step 2 Enable the handling of large objects (aka OData streams)
+
Step 3 Enhance projected business object data model
+
Step 4 Enhance metadata extension to adjust UI semantics
+
Step 5 Preview and test enhanced travel app
+
Step 6 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 6
1. Enhance base business object data model 2. Enable the handling of large objects (aka OData streams) 3. Enhance projected business object data model 4. Enhance metadata extension to adjust UI semantics 5. Preview and test enhanced travel app 6. Test yourself

Learn more →