How To Fix ESH_ENG_CDSVAL_ES037 - '@UI' must be annotated (at header and elements)


SAP Error Message - Details

  • Message type: E = Error

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

  • Message number: 037

  • Message text: '@UI' must be annotated (at header and elements)

  • Show details Hide details
  • What causes this issue?

    The presentation of search results on a generic search UI relies on the
    annotations of domain @UI. Therefore, these annotations are mandatory.

    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?

    Add @UI-annotation, at least in their minimal scope for
    @UI.headerInfo.title, @UI.identification. See consulting note 2407921
    for the relevant annotations and their effect.

    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_ES037 - '@UI' must be annotated (at header and elements) ?

    The SAP error message ESH_ENG_CDSVAL_ES037 '@UI' must be annotated (at header and elements) typically occurs in the context of Core Data Services (CDS) views in SAP, particularly when working with annotations for UI elements in Fiori applications. This error indicates that the required UI annotations are missing from the CDS view definition.

    Cause:

    The error arises when:

    1. The CDS view is expected to have UI annotations that define how the data should be presented in the user interface, but these annotations are not present.
    2. The @UI annotation is required at both the header level of the CDS view and for the individual elements (fields) that are part of the view.

    Solution:

    To resolve this error, you need to ensure that the necessary @UI annotations are included in your CDS view definition. Here are the steps to do this:

    1. Open the CDS View Definition: Access the CDS view in the ABAP Development Tools (ADT) or the relevant development environment.

    2. Add UI Annotations:

      • At the header level of the CDS view, you should include the @UI annotation to define the overall UI behavior.
      • For each field (element) in the CDS view, you should also add the appropriate @UI annotations to specify how each field should be displayed in the UI.

      Example:

      @AbapCatalog.sqlViewName: 'Z_MY_CDS_VIEW'
      @AbapCatalog.compiler.compareFilter: true
      @UI.headerInfo: { 
          typeName: 'My Type', 
          typeNamePlural: 'My Types' 
      }
      define view Z_MY_CDS_VIEW as select from my_table
      {
          key field1 as Field1,
          field2 as Field2,
          @UI.lineItem: [{ position: 10 }]
          field3 as Field3
      }
    3. Check for Required Annotations: Ensure that you are using the correct annotations as per your requirements. Common @UI annotations include:

      • @UI.lineItem: For defining fields that should be displayed in a list.
      • @UI.headerInfo: For defining header information.
      • @UI.selectionField: For fields that should be available for selection in filters.
    4. Activate the CDS View: After making the necessary changes, activate the CDS view to apply the annotations.

    5. Test the Changes: Once activated, test the CDS view in the Fiori application or the relevant UI to ensure that the error is resolved and the UI behaves as expected.

    Related Information:

    • Documentation: Refer to the SAP Help Portal for detailed information on CDS views and UI annotations.
    • SAP Notes: Check for any relevant SAP Notes that might provide additional insights or fixes related to this error.
    • Community Forums: Engage with the SAP Community for discussions and solutions shared by other developers who may have encountered similar issues.

    By ensuring that the required @UI annotations are properly defined in your CDS view, you should be able to resolve the error and enhance the usability of your Fiori applications.

    • 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 simplifies finding the accurate answers to SAP message errors. I now use every week. A must have tool for anyone working with SAP! Highly recommended!
Rate 1
Kent Bettisworth
Executive SAP Consultant