ITPub博客

首页 > 应用开发 > IT综合 > 在SAP WebIDE里使用Fiori Elements快速开发SAP UI5应用

在SAP WebIDE里使用Fiori Elements快速开发SAP UI5应用

原创 IT综合 作者:i042416 时间:2020-09-18 10:02:48 0 删除 编辑

(1) Create CDS view based on sample database table spfli and scarr

Create two CDS views in ABAP development studio. The source code for both are listed below. You just need to copy them into studio and click activate button.

@AbapCatalog.sqlViewName: 'zjerrySQL0309'@AbapCatalog.compiler.compareFilter: true@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'test 20160309'@ObjectModel: {
   createEnabled,
   deleteEnabled,
   updateEnabled}define view Zjerrytest20160309as select from spfli association [0..1] to scarr as _scarron _scarr.carrid = spfli.carrid {
       key spfli.carrid,
       key _scarr.carrname,
       key spfli.connid,
       spfli.cityfrom,
       spfli.cityto}@AbapCatalog.sqlViewName: 'z20160316'@AbapCatalog.compiler.compareFilter: true@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'test odata publish '@OData.publish: true@ObjectModel: {
   type: #CONSUMPTION,
   compositionRoot,
   semanticKey: ['Actor'],
   createEnabled,
   deleteEnabled,
   updateEnabled}define view Zjerrytest20160316 as select from Zjerrytest20160309 {
    @UI.lineItem : [{position:10}]
    key Zjerrytest20160309.carrid as Jerryid,
    @UI.lineItem : [{position:20}]
    key Zjerrytest20160309.carrname as name,
    @UI.lineItem : [{position:30}]
    key Zjerrytest20160309.cityfrom as startLocation,
    @UI.lineItem : [{position:40}]
    key Zjerrytest20160309.cityto as target,
    @UI.lineItem : [{position:50}]
    key Zjerrytest20160309.connid}

Once activated, there is a hint in studio to tell you the automatically published OData service name, and then tcode for service registration.



(2) Use tcode /IWFND/MAINT_SERVICE to finish OData service registration



Specify System Alias = LOCAL and search using the CDS name you get from step1, select the search result and click “Add Selected Services”:



Once added, click “SAP Gateway Client” to test whether the OData service works:



Make sure the metadata request returns 200 success code.



(3) Create UI5 application using Wizard in WebIDE

Open WebIDE, File->New->Project from Template, choose Smart Template Application and next:



Select the destination for your backend where CDS view is created, and locate your OData service created just now:



The annotation file is automatically identified, just click Next button:



Choose OData Collection from drop down list and click Finish button:



Once created, the project looks like below. Choose Component.js and click Run button in WebIDE Toolbar:



From rendered application you could see the table is now filled with data fetched from CDS view:



Build a Productive Fiori application in CRM Service area

Would you like to use the introduced technology to build a more complicated and productive Fiori application in CRM Service area? Then follow the steps in this blog  Create a CRM Service Order Fiori application within a couple of minutes.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24475491/viewspace-2722153/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
SAP成都研究院开发专家,SAP社区导师,SAP中国技术大使。

注册时间:2018-01-20

  • 博文量
    1914
  • 访问量
    883009