From Create Fiori List App Report with ABAP CDS view – PART 1

In this blog, I am going to show How CDS view can be used to generate a Fiori List App Report. Below are the steps that need to be implemented to generate Fiori List App Report.

  1. CDS annotations for Fiori List Report.
  2. How to create a Gateway service from ABAP CDS view
  3. How to create a Fiori List App report in Web IDE.
  4. How to Deploy the Fiori Application.
  5. Create a Custom Semantic Object.
  6. Create a Tile in Fiori.
  7. Adding Tile from Catalogs –> Groups.

So Lets Begin with….

1. CDS view with Annotations for Fiori List Report:

Make sure you set @OData.publish annaotation set to True in order to enable the service to Fiori.

Also you can set below CDS view annotation for UI interface.

@UI.HeaderInfo – to display the header information for the list report.

@UI.selectionField.position – this is for filter option

@UI.lineItem.position – This is for Positioning the filed in the Report Layout

@UI.hidden – If you want to hide the filed in Fiori side

@UI.lineItem.exclude – If you want to exclude the filed in Report Layout by default.

and many more…..

You must use Associations in order to bring Value help feature in filters.

Below is the sample CDS view code with UI Annotations, OData, Associations etc.,

@AbapCatalog.sqlViewName: 'ZDEMOCOMPWHR'
@AbapCatalog.compiler.compareFilter: true
@VDM.viewType: #CONSUMPTION
@OData.publish: true
@EndUserText.label: 'Fiori - Demo List Report App' @UI.headerInfo: {
typeName : 'Demo List Report App' ,
typeNamePlural: 'Demo List Report App' } define view ZDEMO_COMP as select from ZDEMO_COMPWHR association [0..1] to I_Material as _Material on $projection.KMAT = _Material.Material
association [0..1] to ZCX1_PRO_OWNER as _OWNER on $projection.Owner = _OWNER.owner { @UI.selectionField.position: 20
@Consumption.valueHelp: '_OWNER'
//@UI.lineItem.position: 10
@EndUserText.label:'Owner'
Owner, _OWNER, @UI.selectionField.position: 30
@Consumption.valueHelp: '_Material'
//@UI.lineItem.position: 20
@EndUserText.label:'KMAT (Material)'
KMAT, _Material, //@UI.lineItem.position: 30
@EndUserText.label:'Sequence'
sequence, //@UI.lineItem.position: 40
@EndUserText.label:'Characteristic 1'
Characteristic1, //@UI.lineItem.position: 50
@EndUserText.label:'Characteristic Value 1'
CharacteristicValue1, @UI.selectionField.position: 70
//@UI.lineItem.position: 510
@EndUserText.label:'Valid To'
@UI.lineItem.exclude: true
@Semantics.businessDate.to: true
//validto,
case when validto = '' then '00000000'
else validto end as validto, @UI.hidden: true
//@UI.lineItem.position: 520
@DefaultAggregation: #MAX
1 as counter }

  

If you want ValueHelp in the List report filters to select the Prompts, then you need to implement the associations in the CDS view as mentioned in the above code, I have implemented ValueHelp for Material & Owner.

2. How to create GateWay Service for CDS view:

  • Make sure you enabled the OData annotation is set to “true” in the CDS view.
  • Go to tcode – /IWFND/MAINT_SERVICE in SAP and click on Add Service.

  • Give Local in the system Alias and click on Get Services button. Once you see all the list, find your service which starts with CDS view name from the list below and Click Add Selected Services button.

  • Give Package Assignment  and click on Continue.

  • It will prompt for a Transport request for the Gateway service. Select the Transport request or create a new TR and Click on Continue.
  • Now, go back to main page and find the Service that starts with CDS view name. Select the service and Make sure the status of ICF Node status is Active. Also you can click on Load Metadata button to refresh the Metadata.

  • To test the service is working or not, Select the service and click on SAP Gateway Client.

  • Click on Execute button and you can see the status reason is OK.

3. How to create Fiori List Report in Web IDE:

  • Login into SAP Cloud Platform Web IDE.
  • Go to Development -> Workspace -> New -> Project from Template.

  • Select List Report Application, select the current UI5 Version and Click “Next”.

  • Give Project Name and Title and Description for the New List report App and Click “Next”.

  • Select the SAP system from the Service Catalog. In this case, I select system and select the Gateway service which is based on CDS View and Click “Next”.

  • Click Next, and then select OData Collection as ZDEMO_COMP (CDS view) and click Finish.

  • Now, you can see the List report Application is created under Workspace. You can test the List report app within Web IDE by clicking the “Run” button.

  • You can choose the file to run the List report application. In this case, I selected the flpSandbox.html.

  • It will open new window from the Web IDE with a tile for testing. Click on the tile.

  • You can test if the report is working fine. By clicking the settings button, you can select the columns you want to show in the report layout and click Go button to run the report.

4. How to deploy the Fiori Application:

  • Logon to SAP Cloud Platform Web IDE and go to your project -> Deploy -> Deploy to SAPUI5 ABAP Repository.

  • If it’s a new application to Deploy, then click the Deploy a new application or click on Update an existing application and then click “Next”.

  • Give the application a Name which starts with ‘Z’ otherwise it won’t create the application, also give the package and click “Next”.

  • Select transport request if asked and then click “Next”.
  • Click Finish.

  • You can see the status of the Deployment in main screen of the Web IDE ( top right corner).

After the Deployment of the Application is complete to Repository , you can create custom semantic object and a tile in Fiori which we can discuss this in PART 2 of this blog.

Thanks!!

Create Fiori List App Report with ABAP CDS view – PART 1的更多相关文章

  1. Create Fiori List App Report with ABAP CDS view – PART 2

    In the Part 1 blog, we have discussed below topics CDS annotations for Fiori List Report. How to cre ...

  2. CDS测试框架介绍:如何为ABAP CDS Entities写测试

    动机 现在大家都知道单元测试对我们代码的好处.并且我们都承认它是开发过程中不可或缺的一部分.但是在把代码切换到数据库的模式下的时候,我们被粗暴地打回了软件测试的黑暗年代...我们现在面临着逻辑下推到A ...

  3. ABAP-Eclipse ADT中创建ABAP CDS视图

    Create an ABAP Project in ABAP Development Tools (ADT): https://developers.sap.com/tutorials/abap-cr ...

  4. Jerry的通过CDS view + Smart Template 开发Fiori应用的blog合集

    S4/HANA里有一个新的UI框架叫做Smart template, 配合ABAP后台的CDS view技术,能够让developer以Metadata driven的方式来开发Fiori应用, 这种 ...

  5. ABAP CDS - Syntax

    The syntax of the DDL and of the DCL of the ABAP CDS comprises elements of the general DDL and DCL o ...

  6. 如何在SAP云平台ABAP编程环境里把CDS view暴露成OData服务

    Jerry 2016年在学习SAP CDS view时,曾经写过一个CDS view的自学系列,其中有一篇提到了一个很方便的注解: @OData.publish: true 加上这个注解的CDS vi ...

  7. HANA CDS与ABAP CDS

    如果你在网络或者SCN上面搜索CDS,即SAP的Core Data Services,你会很容易地找到类似“Core Data Services(CDS)是一个在SAP HANA中用于定义和消费富语义 ...

  8. ABAP CDS Table Function介绍与示例

    Core data services(以下简称CDS)可以指两样东西,一个是HANA CDS,一个是ABAP CDS. 如我们所知,HANA CDS只支持HANA数据库,ABAP CDS理论上支持多种 ...

  9. 使用ABAP CDS视图创建服务

    介绍本文介绍使用ABAP Core Data Services创建OData服务的最快方法. 给出了有关@ OData.publish注释利用率,对数据源CDS实体的引用和从DDIC结构导入的详细信息 ...

随机推荐

  1. helm回滚应用

    helm状态显示为部署,但容器可能不是running 以下是helm的解释 大概意思是helm只要在k8s上执行完成就当做成功,容器部署到创建状态已经不在Helm的角色设定里了 执行回滚前先模拟下过程 ...

  2. chpasswd

    功能说明:从标准输入中读取一定格式的用户名.密码来批量更新用户的密码,其格式为 “用户名:密码”. 参数选项:-e 默认格式是明文密码,使用-e参数则需要加密的密码.

  3. userdel

    功能说明:用于删除指定的用户及该用户相关的文件. 参数选项:-f 强制删除用户,即使用户当前已登录.-r 删除用户的同时,删除与用户相关的所有文件. 说明:尽量不要用userdel删除用户,而是采用在 ...

  4. 【洛谷5294】[HNOI2019] 序列(主席树维护单调栈+二分)

    点此看题面 大致题意: 给你一个长度为\(n\)的序列\(A\),每次询问修改一个元素(只对当前询问有效),然后让你找到一个不下降序列\(B\),使得这两个序列相应位置之差的平方和最小,并输出这个最小 ...

  5. 推箱子Unity

    逻辑首先有控制台写了一下. 需要注意的地方不少: 进一步,需要考虑3个层面的问题. 前面的位置是空地,成功点,墙,还是箱子. 前面是箱子的时候,箱子的前面是空地,墙,成功点,还是箱子. 当移动的时候, ...

  6. 树状数组 && 线段树应用 -- 求逆序数

    参考:算法学习(二)——树状数组求逆序数 .线段树或树状数组求逆序数(附例题) 应用树状数组 || 线段树求逆序数是一种很巧妙的技巧,这个技巧的关键在于如何把原来单纯的求区间和操作转换为 求小于等于a ...

  7. STL - set【集合】

    参考:http://www.cplusplus.com/reference/set/set/ 一.set 是按特定顺序存储唯一元素的容器 实现是一种非常高效的平衡检索二叉树:红黑树(Red-Black ...

  8. XCode项目配置可访问 非 https 接口的方法

    打开项目的info.plist文件,右键- open as sourceCode .在代码中添加: <key>NSAppTransportSecurity</key> < ...

  9. HDU 1399 Starship Hakodate-maru(暴力搜索)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1399 Starship Hakodate-maru Time Limit: 2000/1000 MS ...

  10. UVA - 136 Ugly Numbers(丑数,STL优先队列+set)

    Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9 ...