<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Fixed value List with CDS annotations in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479809#M82865</link>
    <description>&lt;P&gt;Annotate your value help CDS view with&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;@ObjectModel.resultSet.sizeCategory: #XS&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will automatically create the fixed-values metadata annotation and shows a dropdown in Fiori Elements.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jan 2019 12:57:10 GMT</pubDate>
    <dc:creator>janmattfeld</dc:creator>
    <dc:date>2019-01-11T12:57:10Z</dc:date>
    <item>
      <title>Fixed value List with CDS annotations</title>
      <link>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaq-p/479803</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I'm creating a Fiori app using fiori elements/templates and CDS annotations.&lt;/P&gt;
  &lt;P&gt;One of the fields requires a search-help value list, This just needs to be a drop down list with PASS and FAIL in it.&lt;/P&gt;
  &lt;P&gt;I have created another view that returns a table with these results and then create a foreign key association and linked the field to the value help&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;@Consumption.valueHelp:'_Result'&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;@ObjectModel:{foreignKey.association:'_Result',mandatory:true}&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;ZHEADER&lt;STRONG&gt;.&lt;/STRONG&gt;qires&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;This is working however the result is a two step search help (i.e. I click on the possible entries which brings up a dialog box where I then have to click go to show the list of entries as per below). &lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;EM&gt;&lt;/EM&gt;&lt;EM&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/51419-gldnas01homeandrewnmydocstwophase.jpg" /&gt;&lt;/P&gt;&lt;/EM&gt;
  &lt;P&gt;&lt;EM&gt;Is it possible to get the entries to appear as an immediate list similar to the one below?&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;Can this be done via annotations?&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;Any help much appreciated&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;EM&gt;&lt;/EM&gt;&lt;EM&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/51417-gldnas01homeandrewnmydocsdropdown.jpg" /&gt;&lt;/P&gt;&lt;/EM&gt;</description>
      <pubDate>Thu, 13 Jul 2017 07:35:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaq-p/479803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-07-13T07:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed value List with CDS annotations</title>
      <link>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479804#M82860</link>
      <description>&lt;P&gt;Hi Andrew, &lt;/P&gt;
  &lt;P&gt;This is an feature which I am also interested in it. I think for now there is only the implementation approach available to define such dropdown list. See here: &lt;/P&gt;
  &lt;P&gt;&lt;A href="https://blogs.sap.com/2016/04/27/how-to-build-drop-down-list-based-on-fixed-value-defined-in-a-domain/" target="test_blank"&gt;https://blogs.sap.com/2016/04/27/how-to-build-drop-down-list-based-on-fixed-value-defined-in-a-domain/&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;I hope that sun there will be a ABAP CDS View Annotation which you can add to element level and define a field as dropdown list.&lt;/P&gt;
  &lt;P&gt;Kind regards,&lt;/P&gt;
  &lt;P&gt;Catalin&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 14:23:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479804#M82860</guid>
      <dc:creator>former_member383742</dc:creator>
      <dc:date>2017-07-21T14:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed value List with CDS annotations</title>
      <link>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479805#M82861</link>
      <description>&lt;P&gt;Thanks Chiuaru,&lt;/P&gt;
  &lt;P&gt;I've tried to follow this blog but can't get it to work. The the end I've had to extend the app and add a custom field and bind it to my CDS view field.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 01:54:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479805#M82861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-08-10T01:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed value List with CDS annotations</title>
      <link>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479806#M82862</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt;
  &lt;P&gt;I'm trying to create the Value help as what you did in the above question. but unable to get the desired F4.&lt;/P&gt;
  &lt;P&gt;I'm fetching data from another CDS View which is working fine but when i use it as association in my Consumption View, it doesn't show up. Instead it shows the standard Search Help Window.&lt;/P&gt;
  &lt;P&gt;Can you please help me with the annotations required in Consumption View?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 15:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479806#M82862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-27T15:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed value List with CDS annotations</title>
      <link>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479807#M82863</link>
      <description>&lt;P&gt;Hi Vinay,&lt;/P&gt;
  &lt;P&gt;in the end I did manage to get the blog to work. You need to redefine the 'DEFINE' method of your model provider (MPC) class.&lt;/P&gt;
  &lt;P&gt;Here is a sample of the code (qires is the name of the field that I want to have the look up) &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;method DEFINE.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;* Method-local declarations:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DATA lo_entity_setTYPE REF TO /iwbep/if_mgw_odata_entity_set.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DATA lo_propertyTYPE REF TO /iwbep/if_mgw_odata_property.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DATA lo_annotationTYPE REF TO /iwbep/if_mgw_odata_annotation.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;*Call parent:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;super-&amp;gt;define( ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_entity_set = model-&amp;gt;get_entity_set( 'ZMYENTITYSET' ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_annotation = lo_entity_set-&amp;gt;create_annotation( 'sap' ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_annotation-&amp;gt;add( iv_key = 'semantics' iv_value = 'fixed-values').&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DATA(lo_entitytype) = model-&amp;gt;get_entity_type( 'ZMYENTITYSETType' ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_entitytype-&amp;gt;set_is_value_list( abap_true ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;data(lo_txt_property) = model-&amp;gt;get_entity_type( 'ZMYENTITYSETType' )-&amp;gt;get_property( 'qires' ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_txt_property-&amp;gt;set_value_list( /iwbep/if_mgw_odata_property=&amp;gt;gcs_value_list_type_property-fixed_values ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;data(lo_text_anno) = lo_txt_property-&amp;gt;/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_text_anno-&amp;gt;add( iv_key = 'text' iv_value = 'to_result/qires').&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_txt_property = model-&amp;gt;get_entity_type( 'ZMYCDSLOOKUPVIEWType' )-&amp;gt;get_property( 'qires' ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_txt_property-&amp;gt;set_value_list( /iwbep/if_mgw_odata_property=&amp;gt;gcs_value_list_type_property-fixed_values ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_text_anno = lo_txt_property-&amp;gt;/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' ).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;lo_text_anno-&amp;gt;add( iv_key = 'text' iv_value = 'qires').&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;endmethod.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 01:19:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479807#M82863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-28T01:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed value List with CDS annotations</title>
      <link>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479808#M82864</link>
      <description>&lt;P&gt;Add the below annotation in your value help view&lt;/P&gt;&lt;P&gt;@ObjectModel.resultSet.sizeCategory:#XS&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 06:30:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479808#M82864</guid>
      <dc:creator>lavanyar087</dc:creator>
      <dc:date>2018-11-12T06:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed value List with CDS annotations</title>
      <link>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479809#M82865</link>
      <description>&lt;P&gt;Annotate your value help CDS view with&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;@ObjectModel.resultSet.sizeCategory: #XS&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will automatically create the fixed-values metadata annotation and shows a dropdown in Fiori Elements.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 12:57:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fixed-value-list-with-cds-annotations/qaa-p/479809#M82865</guid>
      <dc:creator>janmattfeld</dc:creator>
      <dc:date>2019-01-11T12:57:10Z</dc:date>
    </item>
  </channel>
</rss>

