Explaining Basic Annotations for List Report

Objectives
After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Explain the basic annotations for creating a list report
  • Describe options for adjusting the display of columns

List Report

List Report Overview

The list report is a full screen floorplan. It can also be used in flexible column layout, where it is usually displayed in the first column.

The list report page is based on the dynamic page, and is divided into a header area and a content area, as defined by the dynamic page layout.

Note
The footer toolbar: if needed, use a footer toolbar to display the messaging button and finalizing actions

Basic Annotations for Creating a List Report

Mandatory Annotations

In the figure below you can see how mandatory CDS annotations are generated at runtime in OData annotations and therefore affect UI in a list report.

The following are typical mandatory annotations:

@OData.publish:true

Auto exposures the CDS view as OData Service.

@UI.headerInfo.typeNamePlural

Determines the text displayed on the upper left corner of the list report.

Annotations for Adding Columns to Report

Annotation @UI.lineItem is used to set default columns for list report.

The Data types for @UI.lineItem are a collection of Data Fields, but in most cases only one @UI.lineItem exists for a field.

The mandatory property is position, which determines the sequence of columns. The label for each field comes from field label of data element for a fields.

You can also add a calculated field to a list report. Since the fields do not reference a data element, you need to either assign it a label by using @UI.lineItem.lable, or convert the data type to a data element by using function cast.

Lets' check your understanding of the concept.

Add Columns with Guided Development

This guide helps you add new columns to a table by configuring the annotation term UI.LineItem, which represents an ordered collection of records representing data fields in a table. You can also rearrange and delete new and existing columns.

Annotations for Semantic Information

The following items should be noted when adding semantic Information for Amount/Quantity fields:

  • For amount and quantity fields, you should point out where to find its currency/unit fields.
  • Fields selecting from DDIC or other CDS entities may already have this information. If it is defined correctly, the currency/unit displays with the amount/quantity fields.

Let's compare 2 code snippet.

Options for Adjusting the Display of Columns

The controls used in a list report are designed for all clients.

Different clients have different screen widths. The fields displayed in a Smart Phone should be smaller than a desktop browser.

Use @UI.lineitem.importance to determine in which clients the field should display:

  • #HIGH: Default value, display in all clients

  • #MEDIUM: Only display in desktop browser or tablet

  • #LOW: Only display in desktop browser

The figure shows that the UI Importance of the SalesOrderID column is set to Low in the Guided Development. This means that the column will only display in desktop browser. 

Hiding Fields

Some fields are not suitable for displaying on the report. You can use @UI.hidden to hide them in the table settings dialog.

Save progress to your learning plan by logging in or creating an account