cancel
Showing results for 
Search instead for 
Did you mean: 

How to make UI.DataField as Dropdown in WEBIDE Annotation Modeler?

0 Kudos

Sap Web IDE comprises of several features and plugins.

With the help of Annotation Modeler tool there is possibility to add or modify annotations in UI project.

Is there a possibility with the help of Annotation Modeler tool to make UI.DataField, which looks in edit mode not as text field (input), but as dropdown (select with several options) on Fiori Object Page?

Accepted Solutions (0)

Answers (1)

Answers (1)

mvaibhav
Contributor

hi Valerjans,

As far as i Know, I don't think its possible using the Annotation modeller.

However in order to display any field as drop down , you will have to modify the metadata of your entity so that the field(property) hasthe additional features in metadata like sap:filter-restriction="single-value"(Single Value Selection on UI) and sap:value-list="fixed-values" (Display as Dropdown)

Sample property below :

<Property Name="DELKZ" Type="Edm.String" Nullable="false" MaxLength="1" sap:filter-restriction="single-value"
sap:label="Display Deleted Task Lists" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:value-list="fixed-values"/>

Thanks,

Vaibhav

valerjans
Explorer
0 Kudos

Great! But what if metadata comes from xsodata service (not local file)? What must be done in xsodata file for appearing sap:value-list="fixed-values" (Display as Dropdown) in metadata?

mvaibhav
Contributor
0 Kudos

Please refer the following URL for Enabling Annotations in XSODATA service and adding specific annotations to properties.

Enable SAP OData Annotations

Also please refer to the following thread where they mention that

Annotate your value help CDS view with

@ObjectModel.resultSet.sizeCategory:#XS

This will automatically create the fixed-values metadata annotation and shows a dropdown in Fiori Elements.

https://answers.sap.com/questions/252804/fixed-value-list-with-cds-annotations.html

Thanks,

Vaibhav

valerjans
Explorer
0 Kudos

Thank you, Vaibhav Maheshwari! But what if xsodata service uses not CDS view, but a SQL view, defined in hdbview file (created in the same WEBIDE), where adding above mentioned annotation (@ObjectModel...) to property causes error (incorrect syntax near "@ObjectModel")?