Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
17,555
In this post I will showcase some of the features controlled by OData annotations. With the use of annotations in OData, we can minimize the UI View code to be written for conventional scenarios like showing text and filtering data.

Example 1: Showing search help for Filter in Personalization Dialog

Example 2: Showing Text

Example 1


The p13n dialog control provides a dialog for tables that allows the user to personalize one or more of the following attributes:

  • Columns

  • Sort

  • Filter

  • Group


 

The third tab is the Filter tab, which allows the user to filter based on specific criteria.

The filter criteria can be included or excluded in the relevant section of the filter.

The user selects the column to be filtered. Any of the columns can be selected from the dropdown.

The second field offers an operator for specifying the filter in more detail. The operators that are available depends on the data type of the selected column.

Scenario

Created OData ‘ZTEST_SEARCHHElP’

Main Entity: Customer

Value Help Entity: Customer Value Help


Click on Annotation at properties



Click on com.sap.vocabularies.Common.v1


Click on ValueList-> Create Annotation


Pass the ValueHelp Entity in label and ValueHelp Entityset in CollectionPath

In Parameters


For ValuelistParameterInOut


For ValueListParameterDisplay


In DPC_EXT we need to implement the CustomerValueHelp entityset to fetch the value


2> Text name

We need to Click on Annotation->com.sap.vocabularies.Common.v1->Text


Create Annotation and pass the name of the customer


The value will be displayed as below.

12 Comments
ChristianKloy
Explorer
0 Kudos
Hi, thanks for this great blog.

I also use this Annotation-Feature in the Service-Builder, but one thing is missing: Where can I define the Qualifiers for some Annotations, e.g. "FieldGroup"?

In the Annotation-Modeler of the Web-IDE is it maintenable:

Vijay
Active Contributor
0 Kudos
nice. Thanks for Sharing 1388263 !
0 Kudos

Hi . Thanks for the Compliment

We can define Field Group in com.sap.vocabularies.UI.v1

 

0 Kudos
Thank You
former_member694689
Discoverer
0 Kudos
Hi 1388263

Thanks for sharing. If it is possible, do u have any idea for my question? https://answers.sap.com/questions/13107727/annotation-segw-travel-request-v2.html

 

Thanks.
Hello  1388263

In my SEGW transaction I don't have this button "Annotations". Do you know what I need to setup or customize to add this button?


Annotations

0 Kudos
Hello Yury,

I have the same problem, I am not able to see the Annotations button.

Did you manage to find the answer?

Regards,

Arul.
0 Kudos
When you are creating the project please select Service with Vocabulary based Annotation as Project type

former_member772557
Discoverer
0 Kudos

Even though I can see the Annotations button, but it's gray. I can do nothing about it.

former_member772557
Discoverer
0 Kudos
Solved, by doing one step:

  1. Import the vocabulary in the OData – Right click on Data Model -> Import -> Vocabulary

0 Kudos
Hi ckloy,

 

can please share the details of How to add annotations in ui5 webIDE..

 
0 Kudos
Hi ckloy,

can you please share the details of how you add annotations in Ui5 webIDE..