In this exercise, you will add a title and a description to the object page. You will also add a title to the list report table.
Prerequisites
You have completed the exercise Add Description Text Instead of Codes for the Overall Status in the same unit (lesson: Creating a List Report).
Watch the Simulation and Perform the Steps
This exercise contains a simulation that takes you through detailed steps. You can find all the steps after the simulation. You can follow the simulation and perform the steps using your own trial account.
Steps
You have the list report from your previous exercise open in your browser.
Select a travel from the list. The object page opens but only a technical ID of the travel is displayed, as the object page is still empty.
Open ADT and expand the Metadata Extensions folder within Project Explorer.
Add a title to the list report table, and a title and description to the object page.
Double-click the metadata extension ZC_FE_TRAVEL_######. The metadata extension of the Travel entity opens.
Add the @UI.headerInfo annotation right on top of the file, as shown in the following sample code.
Code Snippet123456@UI.headerInfo: { typeNamePlural: 'Travels', typeName: 'Travel', title: { type: #STANDARD, value: 'Description'}, description: { type: #STANDARD, value: 'TravelID'} }The typeNamePlural property defines the title of the list report. The value of this annotation is a string.
The typeName property for the object page title is displayed in the top center position of the object page. The value of this annotation is a string.
The title property defines what is displayed in the left upper corner of the object page. The value of this property is the Description field of the Travel entity.
The description property of the @UI.headerInfo annotation defines what is displayed underneath the title in the left upper corner of the object page.
Click Activate from the menu bar to save and activate your changes.
Switch to the app preview in your browser. You can see that the title of the list report table has been added.
Select Go from the table. The list report table is displayed.
Select the travel as before. The object page now opens with a title that includes the travel description and travel ID.
Result
You successfully added the title of the list report table. You have displayed the travel ID and travel description for the object page header. Note that you cannot see Travel as the object page title due to certain restrictions of the ADT app preview. You will be able to see that in a real app once you have generated it in SAP Business Application Studio in one of the following exercises.
Note
You can find the solution for this exercise on GitHub.