I have a problem where the smartfield (build in xml view using WebIDE) does not show the description of the key field instead just shows the key field in both the dropdown list columns.
example : 1(1) and the expectation is 1( local tax ) .
My service is built using tcode : SEGW and using WebIDE to develop the ui and annotation for the dropdown as a fixed list.
I see a solution smartfield annotation - valuehelp dropdown , but I am unable to add the sap:text to my service in SEGW.
Problem :
Annotation in WebIDE:
</Annotations>
<Annotations Target="Metadata.ET_FV60Header/Pmethod">
<Annotation Term="Common.Text" String="Text1"/>
<Annotation Term="Common.ValueListWithFixedValues" Bool="true"/>
<Annotation Term="Common.ValueList">
<Record>
<PropertyValue Property="CollectionPath" String="VH_PmtMethSet"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterInOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="Pmethod"/>
<PropertyValue Property="ValueListProperty" String="Zlsch"/>
<Annotation Term="Common.Label" String="Text1"/>
</Record>
<Record Type="Common.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty" String="Text1"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
I was able to solve the problem by adding the property "sap:text" to my entity definition in SAP using the following;
Code to be added under DEFINE method
** ET_Entity is my Value Help Entity data model name ( not entity set) ** FIELD_ID is the key property under the above entity to which we want to display the description in the dropdown list. ** FIELD_DESC is the property that contains the description.
Entity metadata :
stackoverflow.com/questions/63374119/… - this post helped me to fix my problem.
@Mahdi , I was able to solve the problem and wanted to tag you.