Skip to Content

Value List annotation for Smart Fields

Hi Gurus,


I need a technical help to make the Value Help feature of Smart Field Control working: https://sapui5.hana.ondemand.com/#docs/guide/3361e270c62c46c9893eaefb2966d62e.html .

Implementation is done, but a small piece is missing in the backend, what I could not identify, due lack of documentation. The annotations metadata is not returned by the backend system. So I need help to find the missing part in implementation of the valuelist annotation in SEGW for an entity property.

1. System environment

Service is implemented in ECC backend

and registered in GateWay HUB system, where the BSP application is deployed

We have SAPUI5 libraries version 1.28.8-10 installed.

I’ve applied latest OSS Notes in both systems regarding annotations, and regenerated runtime objects.


2. Implementation

It consists of two parts:

  1. a.) base project: ZMD_VENDOR
  2. b.) vocabulary project: ZMD_VENDOR_ANNO

SEGW Project is ZMD_VENDOR for which I would like to create valuelist annotations for property Anred (Title)

I defined entity AddressTitle entity and AddressTitles entityset to be used in valuelist annotation



Since the project ZMD_VENDOR is of type Service with SAP Annotations, I had to create a new project ZMD_VENDOR_ANNO with type Annotation Model for Referenced service, importing vocabulary (/IWBEP/VOC_COMMON/com.sap.vocabularies.Common.v1), and service reference to ZECC_MD_VENDOR.

I set Text annotations for AddressTitle


and valuelist annotation for property Anred (Title)


After generation and service registration, I can see that now the annotation service is properly assigned to the base service in

/IWBEP/REG_VOCAN - Maintain Vocabulary Annotations

I added the following code part to the base service model provider class extension to register the annotation model using its technical model name ZMD_VENDOR_ANNO_MDL.

Metadata of the annotation service seems fine:

The annotation model seems referenced in base service metadata,but the problem is (why the smart field on the UI is not showing valuehelp/dropdownlist), that the annotation tags and properties are missing in metadata xml below, for which I created the annotations in annotation project:

Metadata: (collapsed)

Metadata: Request entity with entity property Anred(Title) (expanded)

AddressTitle entity, with property Title (expanded)

Reason is unknown for the missing annotations. Anyone any idea or example on this.


Thank you!


P.S.:


Smart controls and OData annotations v4 are great, can reduce UI implementation costs, and keep logic in the backend, However documentation not really available on this concept, and about the framework, Do you have one ? 😊 I've tried to investigate examples, but there is only an sflight test annotation service and class in the backend. but this is annotation within the same model. Now I need to do external annotations.




01_ecc_sw.png (6.1 kB)
02_gw_sw.png (5.3 kB)
03.png (64.7 kB)
04.png (29.7 kB)
05.png (44.7 kB)
06.png (62.6 kB)
07.png (71.7 kB)
08.png (23.2 kB)
09.png (22.2 kB)
10.png (29.8 kB)
11.png (5.9 kB)
12.png (52.4 kB)
13.png (119.5 kB)
14.png (87.3 kB)
15.png (97.9 kB)
16.png (14.8 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Nov 10, 2015 at 03:13 PM

    Hi Attila,

    I have a similar problem with the annotations. I can't even generate the tags in the metadata because i don't see a third option when I create a gateway project. I only see 2:

    This is my component:

    Do you know why I don't see the third option and what can I do about it?

    BTW, for your problem - I don't see the annotation sap:required-in-filter="true" in the property that you want to display. I think that you need that to be set in order for that property to be shown in the smartfilterbar control, beside the other annotation tags.


    Screenshot_4.jpg (38.8 kB)
    Screenshot_5.jpg (65.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 13, 2016 at 08:43 AM

    Hi Attila,

    I saw what you guys talk about above,there are some questions on me.

    First,I want to make sure does this annotation can be used in treetable or smarttable, or both? and is there any more material about how to use annotation for treetable in front-end? for example ,how can we set a field with Input or dropdown and other type....

    Regards

    Dangli

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Dangli,

      value list annotation should result creating the dropdown list by the smart field automatically. You can however overwrite the fieldtype displayed using configuration possibility of the smart field within the xml view. Putting the smart field into tree should work also, like in forms and lists do.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.