SAP Fiori Elements is a powerful framework designed to accelerate the development of SAP Fiori applications by using metadata-driven UIs. It minimizes the need for manual UI coding by leveraging annotations, OData services, and predefined floorplans. One of the key functionalities that business applications must support is CRUD operations—Create, Read, Update, and Delete. This article explores how CRUD operations are handled within SAP Fiori Elements and how developers can enable and customize these features effectively.
CRUD operations form the backbone of most business applications. In SAP Fiori Elements:
These operations are driven by the OData model and configured using annotations and minimal custom logic.
Before enabling CRUD functionality, ensure the following:
This is the most common floorplan used for CRUD operations.
Create:
@UI.LineItem and @UI.CreateHidden annotations.Read:
GET_ENTITYSET and GET_ENTITY methods in the OData service.Update:
@UI.FieldControl.Delete:
Worklist floorplans also support CRUD, mainly focused on processing tasks. The implementation approach is similar to the list report but tailored for operational UIs.
| Annotation | Purpose |
|---|---|
@UI.LineItem |
Defines table content in List Report |
@UI.Facets |
Configures Object Page layout |
@UI.FieldControl |
Controls field editability |
@UI.Hidden / @UI.CreateHidden |
Controls visibility and create actions |
@Capabilities.InsertRestrictions |
Indicates support for Create |
@Capabilities.UpdateRestrictions |
Indicates support for Update |
@Capabilities.DeleteRestrictions |
Indicates support for Delete |
For example:
@UI.lineItem: [{ position: 10 }]
@UI.identification: [{ position: 10 }]
@Capabilities.InsertRestrictions.Insertable: true
@Capabilities.UpdateRestrictions.Updatable: true
@Capabilities.DeleteRestrictions.Deletable: true
While Fiori Elements handles most CRUD actions automatically, developers can enhance behavior via:
@UI.FieldControl.Fiori Elements uses Message Popovers to surface errors and warnings returned from the backend. Developers should ensure that meaningful messages are returned using standard SAP message classes and correct HTTP status codes (e.g., 400 for bad requests).
Handling CRUD operations in SAP Fiori Elements is efficient, standardized, and largely driven by metadata and OData services. By using the right annotations, backend implementation, and Fiori Elements floorplans, developers can deliver enterprise-grade apps with minimal frontend coding effort. This not only speeds up development but also ensures consistency and compliance with SAP’s Fiori UX guidelines.