我为字段formCompanyCode创建了一个值帮助注释,见下面的元数据。
<EntityType sap:content-version="1" Name="shBukrs">
<Key>
<PropertyRef Name="Bukrs"/>
</Key>
<Property Name="Bukrs" sap:label="Company Code" Type="Edm.String" MaxLength="4" sap:creatable="false" Nullable="false"/>
<Property Name="Butxt" sap:filterable="false" sap:sortable="false" sap:updatable="false" sap:label="Company Name" Type="Edm.String" MaxLength="25" sap:creatable="false" Nullable="false"/>
<Property Name="Ort01" sap:filterable="false" sap:sortable="false" sap:updatable="false" sap:label="City" Type="Edm.String" MaxLength="25" sap:creatable="false" Nullable="false"/>
<Property Name="Waers" sap:filterable="false" sap:sortable="false" sap:updatable="false" sap:label="Currency" Type="Edm.String" MaxLength="5" sap:creatable="false" Nullable="false" sap:semantics="currency-code"/>
</EntityType>
<Annotation Term="com.sap.vocabularies.Common.v1.ValueList">
<Record>
<PropertyValue String="shBukrsSet" Property="CollectionPath"/>
<PropertyValue Property="SearchSupported" Bool="true"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="com.sap.vocabularies.Common.v1.ValueListParameterOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="CompanyCode"/>
<PropertyValue String="Bukrs" Property="ValueListProperty"/>
</Record>
<Record Type="com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly">
<PropertyValue String="Butxt" Property="ValueListProperty"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
我已经把这个字段添加到了表单中:
<smartField:SmartLabel labelFor="idCompanyCode"/>
<smartField:SmartField value="{CompanyCode}" id="idCompanyCode"/>
但值帮助并没有附加到表单中的字段上(没有值帮助按钮)... ...
有谁知道是什么问题吗?
解决了... 目标服务名称不见了。
旧的:
<Annotation Term="com.sap.vocabularies.Common.v1.ValueList">
新的:
<Annotation Term="com.sap.vocabularies.Common.v1.ValueList" Target="<service>">
请确保你使用注册服务名称作为目标值。