How To Fix ESH_ENG_CDSVAL_ES021 - '@EnterpriseSearch' requires '@Search'


SAP Error Message - Details

  • Message type: E = Error

  • Message class: ESH_ENG_CDSVAL_ES - ES-CDS/ABAP: Validation of domain @EnterpriseSearch

  • Message number: 021

  • Message text: '@EnterpriseSearch' requires '@Search'

  • Show details Hide details
  • What causes this issue?

    @EnterpriseSearch is an extension to domain @Search; all the annotations
    defined there are relevant for Enterprise Search. Currently, the view
    has @EnterpriseSearch-annotations, but none from domain @Search.

    System Response

    The system issues an error message and will not allow you to continue with this transaction until the error is resolved.

    How to fix this error?

    If you want the view to be consumable in Enterprise Search, add the
    mandatory @Search-annotations.
    If you do not want to annotate the view as @Search.searchable, remove
    all @EnterpriseSearch-annotations or annotate the view explicitly with
    @EnterpriseSearch.enabled: false.

    Procedure for System Administrators


    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message ESH_ENG_CDSVAL_ES021 - '@EnterpriseSearch' requires '@Search' ?

    The SAP error message ESH_ENG_CDSVAL_ES021 indicates that there is a requirement for the '@Search' annotation when using the '@EnterpriseSearch' annotation in a Core Data Services (CDS) view. This error typically arises in the context of SAP's Enterprise Search functionality, which allows for enhanced search capabilities across various data sources.

    Cause:

    The error occurs when:

    • You have defined a CDS view with the @EnterpriseSearch annotation but have not included the required @Search annotation.
    • The system expects the @Search annotation to define how the data should be indexed and searched.

    Solution:

    To resolve this error, you need to ensure that your CDS view includes the @Search annotation along with the @EnterpriseSearch annotation. Here’s how you can do that:

    1. Modify the CDS View: Open the CDS view definition in the ABAP Development Tools (ADT) or the relevant development environment.
    2. Add the @Search Annotation: Include the @Search annotation in your CDS view definition. This annotation typically specifies the search fields and their properties.

    Here is an example of how to define both annotations in a CDS view:

    @AbapCatalog.sqlViewName: 'Z_MY_CDS_VIEW'
    @AbapCatalog.compiler.compareFilter: true
    @Search: { 
        search: true, 
        searchFields: [ 'field1', 'field2' ] 
    }
    @EnterpriseSearch: { 
        search: true 
    }
    define view Z_MY_CDS_VIEW as select from my_table
    {
        key field1,
        field2,
        field3
    }

    Related Information:

    • Documentation: Refer to the SAP Help Portal for detailed documentation on Core Data Services and annotations. This will provide insights into how to properly use annotations like @EnterpriseSearch and @Search.
    • SAP Notes: Check for any relevant SAP Notes that might address specific issues or provide additional guidance on using Enterprise Search with CDS views.
    • Testing: After making changes, activate the CDS view and test the search functionality to ensure that the error is resolved and that the search behaves as expected.

    By ensuring that both annotations are correctly defined, you should be able to eliminate the error and successfully implement Enterprise Search capabilities in your SAP environment.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Start your 7-day free trial now.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
ERPlingo's SAP support assistant is amazing. Saves me countless hours trying to solve complex SAP issues myself. It's a real game changer!
Rate 1
Thomas Michael
SAP Consultant, Author & Speaker