SAP Fiori Elements applications are designed to offer a consistent, efficient, and user-friendly experience when interacting with SAP data. One of the most powerful features of these applications is their search and query functionality, which enables users to explore and analyze enterprise data with precision and speed.
Through intelligent metadata-driven design and deep integration with OData services, SAP Fiori Elements provides a robust set of capabilities for both basic filtering and advanced querying. This article explores how to implement and leverage advanced search and query features in SAP Fiori Elements, enhancing the power of applications such as List Reports and Analytical List Pages.
At the heart of search and query functionality in SAP Fiori Elements is the Smart Filter Bar (SFB). This UI component automatically renders based on metadata annotations and allows users to:
The Smart Filter Bar is tightly integrated with the OData model and is generated with minimal code when annotations are correctly defined.
Enables keyword search across multiple fields, improving discoverability.
Controlled via the @Search.defaultSearchElement and @Search.searchable annotations in CDS or OData metadata.
Example:
@Search.defaultSearchElement: true
@Search.searchable: true
define field CustomerName : String;
@Common.ValueList annotation.onBeforeRebindTable or onInitSmartFilterBarExtension.Here are the most important annotations for enhancing search:
| Annotation | Description |
|---|---|
@UI.SelectionFields |
Defines which fields appear in the filter bar. |
@Search.searchable |
Enables a property for free-text search. |
@Search.defaultSearchElement |
Defines the default field for global search. |
@Common.ValueList |
Connects a field to a value help list or dialog. |
@Consumption.filter |
Fine-tunes how filters behave in CDS views. |
Scenario: You want to build a List Report where users can search for Sales Orders by:
Steps:
CustomerName with @Search.searchable.Country with @Common.ValueList pointing to a Country value set.@UI.SelectionFields to expose these filters in the Smart Filter Bar.Edm.Date to enable the range selector.Advanced search and query capabilities are critical for empowering users in SAP Fiori Elements applications to find and interact with enterprise data quickly and efficiently. By leveraging annotations, value helps, dynamic filtering, and variant management, developers can deliver powerful applications that align closely with user needs—without heavy custom code.
Mastering these features ensures that your SAP Fiori Elements apps are not only functional but also intuitive and enterprise-ready.