天天看点

如何给 SAP Fiori Elements 应用的字段添加 value help

订阅专栏

在 Jerry 的前一篇文章 如何在 SAP BTP 上通过 CDS view 快速创建 Fiori Elements 应用里,我们已经根据 CDS view 创建了一个 Fiori Elements 应用:

如何给 SAP Fiori Elements 应用的字段添加 value help
本文我们给 Agency ID 这个 selection field,添加 value help.
如何给 SAP Fiori Elements 应用的字段添加 value help
现在 Agency ID selection ID,点了 F4 之后,value help 无法工作:
如何给 SAP Fiori Elements 应用的字段添加 value help
给 AgencyID 字段添加如下高亮注解:
如何给 SAP Fiori Elements 应用的字段添加 value help

@Metadata.layer: #CORE
annotate view Z_C_TRAVEL_DATA_JERRY with
{
  @UI           : {
      lineItem      : [{position: 10, importance: #HIGH}],
      selectionField: [{position: 10 }]
  }
  TravelID;
  @UI           : {
      lineItem      : [{position: 15, importance: #HIGH}],
      selectionField: [{position: 20 }]
  }
  @Consumption.valueHelpDefinition: [{  entity: {name: '/DMO/I_Agency', element: 'AgencyID'}  }]
  AgencyID;
  @UI           : {
      lineItem      : [{position: 60, importance: #HIGH}]
      }
  Memo;
}      

同时,在 Service Definition 里将 value help 使用到的 /DMO/I_Agency 也暴露出来:

如何给 SAP Fiori Elements 应用的字段添加 value help

激活后重新刷新 Fiori Elements UI,value help 就能正常工作了:

如何给 SAP Fiori Elements 应用的字段添加 value help

继续阅读