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

Refine the List Report with Annotations

Add additional annotations to show filter fields and columns on the list report as well as to allow the selection of data using a value help.

Overview

🎓 beginner 30 min. SAP FioriSAP Fiori ElementsBeginnerSAP Business Technology PlatformSAP BTP ABAP Environment

You will learn

  • โœ”How to add additional columns and filter fields
  • โœ”How to update the frontend application
  • โœ”How to add list report header information
  • โœ”How to define a value help as a drop-down list
  • โœ”How to define criticality ratings
Unknown U Unknown September 3, 2024
Created by June 22, 2021
Contributors

Prerequisites

Prerequisites

Steps

Intro

Whenever your unique suffix for creating objects is needed, the object names within this tutorial are named with suffix “######”. For the screenshots, the suffix “000100” was used. In the CDS files of your RAP-based service you can add annotations to refine the user interface. These CDS annotations will be translated into OData annotations used by SAP Fiori elements to generate the UIs. UI annotations are stored within metadata extension files to separate them from the CDS view structure for better reading.


Step 1 Create metadata extension file for travel entity
โ€”

Annotations controlling the UI can be stored in metadata extension files. In this section such a file will be created for the Travel entity and a first annotation will be added.

Right click the ZC_FE_TRAVEL_###### projection view for the Travel entity to open the context menu. Choose New Metadata Extension.

Create new metadata extension file
Create new metadata extension file

Enter the name of your metadata extension file. Choose the same name as your projection view file name ZC_FE_TRAVEL_###### and enter a description as well. Choose Next.

Create new metadata extension file
Create new metadata extension file

A transport request is already assigned to the metadata extension file. Choose Finish to confirm the creation of the file.

Create new metadata extension file
Create new metadata extension file

Now open the new metadata extension file ZC_FE_TRAVEL_###### within the Metadata Extensions folder. To show a first column within the list report table, add the content shown in the coding example below. You can use code completion by pressing CTRL-SPACE at the related coding positions, e.g. when adding the @UI.lineItem annotation, just type @UI and then press CTRL-SPACE to choose the entry from the list of proposals.

CDS
@Metadata.layer: #CORE
annotate view ZC_FE_TRAVEL_###### with
{
    @UI.lineItem: [{ position: 10 }]
    TravelID;
}

To finish this step, choose Save and Activate to take over the changes in your metadata extensions file.

Create new metadata extension file
Create new metadata extension file

Check your changes by refreshing of your real application preview in BAS or use the quick service preview in ADT. Choose Go to load the data.

Create new metadata extension file
Create new metadata extension file

You will now see the column Travel ID made visible on the list report table by the @UI.lineItem annotation added to the metadata extensions file. The data shown in the column is loaded from the database with the request triggered by the Go button.

Step 2 Add table columns and filter bar selection fields
+
Step 3 Add header information and default sorting
+
Step 4 Refine columns that have IDs
+
Step 5 Implement value help for selection fields Customer and Status
+
Step 6 Display a description for Status
+
Step 7 Implement the criticality feature
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Create metadata extension file for travel entity 2. Add table columns and filter bar selection fields 3. Add header information and default sorting 4. Refine columns that have IDs 5. Implement value help for selection fields Customer and Status 6. Display a description for Status 7. Implement the criticality feature

Learn more →