SAP RAP Tutorial : Object Page and Facets

Introduction

In SAP RAP programming, designing a user-friendly and structured Fiori UI is just as important as building the backend logic. One of the most powerful UI patterns in SAP Fiori Elements is the Object Page and SAP RAP Facets, which provides a detailed view of a single business object.

In our previous blog – SAP RAP Designing the User Interface, we built a basic application with header details. This blog explores how to configure an Object Page using facets and CDS UI annotations in the ABAP RESTful Application Programming Model (RAP). You’ll learn how to organize data into meaningful sections and enhance the user experience with clean, modular design.


What Is an Object Page?

An Object Page in SAP Fiori is a UI layout that displays detailed information about a single entity (e.g., a travel booking, customer, or flight). It typically includes:

  • A header with key information
  • Multiple facets (sections) that group related data
  • Navigation to related entities

This layout is ideal for transactional apps and master-detail scenarios.


What Are SAP RAP Facets?

Facets are the building blocks of an Object Page. They represent logical sections of the page, such as:

  • General Information
  • Contact Details
  • Related Bookings
  • Supplementary Data

Facets are defined using CDS UI annotations, which control how data is grouped and displayed.

There are tow main types of facets:

  • Collection Facets – displays list of records each of which can display one or more reference facets.
  • Reference Facets – displays information about a single record, such as a line item.

Points to note about SAP RAP Facets

  • Facets can be used to display a wide variety of information such as basic data fields, contact information, images, Maps etc.
  • Can be nested within each other.
  • Facets can be used to control visibility of fields
  • Define order in which fields are displayed
  • Group fields together for filtering or editing

Identification Reference Facet

For our case, we will be using identification_reference facet type.

  • This type of facet is used to display information about a record.
  • Used to display information such as name, address etc.
  • The @UI.identification annotation is used to mark fields that contain identification information.
  • When a field is marked with @UI.identification annotation, the field’s value is displayed in the identification_reference type facet.

Implementing Object Page & SAP RAP Facets

We will now try to create a object page using facets for connection details. For this we will use the annotation @UI.facet to give the facet properties.

SAP RAP tutorial, object page in SAP Fiori, facets in RAP, CDS UI annotations, ABAP RESTful Application Programming Model, SAP Fiori Elements, metadata extensions

We have provided label for the facet and type as identification_reference as we want to display the details of the connections.
Consequently we will mark the fields which we want as part of object page with annotation @UI.identification and provide position or sequence for the display of fields.

SAP RAP tutorial, object page in SAP Fiori, facets in RAP, CDS UI annotations, ABAP RESTful Application Programming Model, SAP Fiori Elements, metadata extensions

Once we have defined the properties, additionally save and activate and refresh our application.

SAP RAP tutorial, object page in SAP Fiori, facets in RAP, CDS UI annotations, ABAP RESTful Application Programming Model, SAP Fiori Elements, metadata extensions

As a result we are able to see an arrow on each line of our list. Once we click on that we are navigated to object page.

SAP RAP tutorial, object page in SAP Fiori, facets in RAP, CDS UI annotations, ABAP RESTful Application Programming Model, SAP Fiori Elements, metadata extensions

We can also change the labels of these fields by providing property label.

SAP RAP tutorial, object page in SAP Fiori, facets in RAP, CDS UI annotations, ABAP RESTful Application Programming Model, SAP Fiori Elements, metadata extensions

Finally now Save, activate and refresh our application.

SAP RAP tutorial, object page in SAP Fiori, facets in RAP, CDS UI annotations, ABAP RESTful Application Programming Model, SAP Fiori Elements, metadata extensions

In effect now the labels are changed.

Conclusion

Designing an effective Object Page using facets in SAP RAP is key to building intuitive and maintainable Fiori applications. With CDS UI annotations and metadata extensions, you can structure your UI directly from the backend, saving time and ensuring consistency.

Do let me know if you liked our blog and stay tuned for the next blog.

Also Read – ABAP RAP Business Objects: Mastering Composition vs. Association

Leave a Comment

Your email address will not be published. Required fields are marked *