Skip to content

Latest commit

 

History

History
86 lines (49 loc) · 2.06 KB

enabling-the-search-function-3cdebee.md

File metadata and controls

86 lines (49 loc) · 2.06 KB

Enabling the Search Function

You can enable the Search function in the list report.

The search is restricted to 1000 characters.

To enable the search function, you must set sap:searchable to true for the root entity set.

List Report: Search

Metadata XML

<EntitySet Name="SEPMRA_C_PD_Product"EntityType="SEPMRA_PROD_MAN.SEPMRA_C_PD_ProductType" sap:searchable="true" sap:content-version="1"/>

The Search field is enabled by default.

If the underlying entity doesn't support the search functionality, you can disable it by setting Searchable to false in the SearchRestriction annotation.

The following sample code shows how to disable the search functionality for the SalesOrder entity:

Sample Code:

XML Annotation

<Annotations Target="SAP__self.Container/SalesOrder">
   <Annotation Term="SAP__capabilities.SearchRestrictions">
      <Record>
         <PropertyValue Property="Searchable" Bool="false" />
      </Record>
   </Annotation>
</Annotations>

Sample Code:

ABAP CDS Annotation

@Search.searchable: false
annotate view ZC_SalesOrder with { };

Sample Code:

CAP CDS Annotation

annotate SalesOrder with @Capabilities: {SearchRestrictions: {Searchable: false}};

For more information about how to enable and disable the Search field for analytical tables, see the corresponding section in Setting the Table Type.

For more information about configuring the filter bar in a list report, see Adapting the Filter Bar.