在CDS的注释语句中自定义搜索帮助可参考SAP 元素域值生成CDS,或者参考公司代码的搜索帮助I_CompanyCode来创建,下面是在SAP中的一些常用的CDS搜索帮助,这样定义好后,发布的ODATA在SAPUI5开发时,使用Fiori Elements开发生动生成SAPUI5程序自动就会有搜索帮助了。
更多的标准CDS说明,可参看CDS Views for Customer and Internal Project Management
1.国家代码
|
1 2 3 4 5 6 7 8 9 |
association [1..1] to I_Country as _Country on $projection.Banks = _Country.Country ...... // @Consumption.valueHelpDefinition: [ // { entity: { name: 'C_BankCountryVH', // element: 'BankCountry' } // }] @ObjectModel.foreignKey.association: '_Country' Banks |
2.公司代码
|
1 2 3 4 5 6 7 8 9 10 |
association [0..1] to I_CompanyCode as _comp on $projection.Bukrs = _comp.CompanyCode ...... // @Consumption.valueHelpDefinition: [ // { entity: { name: 'I_CompanyCode', // element: 'CompanyCode' } // }] @ObjectModel.foreignKey.association: '_comp' bukrs, ...... |
3.银行行号,银行编号
|
1 2 3 4 5 6 7 8 9 10 11 12 |
association [1..1] to I_Bank as _Bank on $projection.Banks = _Bank.BankCountry and $projection.Bankl = _Bank.BankInternalID // @ObjectModel.foreignKey.association: '_Bank' @Consumption.valueHelpDefinition: [ { entity: { name: 'I_BankStdVH', element: 'BankInternalID' }, additionalBinding: [{ localElement: 'Banks', element: 'BankCountry' }] }] ztrt0003.bankl as Bankl, |
