使用SAP Analysis Path Framework (APF)展示CDS view数据

简介: 使用SAP Analysis Path Framework (APF)展示CDS view数据

Analysis Path Framework (APF) is a framework which provides reuse components that allow you to build and enhance interactive analytical Web applications. Recently during my self study, I find out that an OData service exposed by CDS view could easily be consumed by APF.


Here below is detailed step.


For prerequisites to use APF, you can find it in SAP help.

In my case, I have the following PFCG role assigned:


image.png

And this role has the following role menu assigned:

image.png

Step1. Create a simple header and item CDS view, and a consumption view to expose as OData service.

Below source code is for item view:

@AbapCatalog.sqlViewName: 'zorITem'

@AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #CHECK

@EndUserText.label: 'order item detail'

define view Z_I_Order_Item as select from zorder_item {

 key zorder_item.parent_id,

 key zorder_item.item_id,

 zorder_item.item_text

}

Below source code for header view:

@AbapCatalog.sqlViewName: 'zorheader'

@AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #CHECK

@EndUserText.label: 'header view'

define view Z_I_Order_Header as select from zorder_header

association [0..*] to Z_I_Order_Item as _Item

on $projection.object_id = _Item.parent_id

{

 key zorder_header.object_id,

 zorder_header.description,

 @ObjectModel.association.type: #TO_COMPOSITION_CHILD

 _Item

}

The corresponding database in ABAP for these two CDS views are listed below:

image.png

The source code of CDS view:

@AbapCatalog.sqlViewName: 'zjorderview'

@AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #CHECK

@EndUserText.label: 'Jerry order consumption view'

@OData.publish: true

define view Z_C_Order as select from Z_I_Order_Header {

 key Z_I_Order_Header.object_id,

 Z_I_Order_Header.description,

 @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]

 Z_I_Order_Header._Item

}

Since I use the annotation OData.publish:true, so a corresponding OData service Z_C_Order_CDS is generated automatically.

Register it via tcode /IWFND/MAINT_SERVICE. Once done, ensure the metadata access could successfully be done.


image.png

Step2. Expose the created OData service via APF

Click tile APF Configuration Modeler,


image.png

Create a new Application:


image.png

Use the default semantic object:

image.png

Create a new configuration which acts as a container for sub settings such as Filters and Categories:

image.png

In Smart Filter, choose the OData service and entity type created from previous step.

image.png

And a new category:

image.png

Select this new category and create a new step:

image.png

In the step creation page, just select all the two properties exposed by CDS view Z_C_Order, that is:

image.png

Create a new Representation based on this step:

image.pngHere for representation type, I just choose the most simple one: Table. Choose property from drop down list for table display.image.pngOnce done, click execute button, you will see the following screen:image.pngThen choose the table representation:image.pngThen the table is displayed as expected:image.pngIts content matches with the data in the corresponding database table.

image.png

相关文章
|
1月前
|
存储 安全 数据管理
SAP 产品 data archive 数据归档的重要性
SAP 产品 data archive 数据归档的重要性
|
1月前
|
存储 供应链 安全
SAP S4HANA 数据归档的实施方法
SAP S4HANA 数据归档的实施方法
|
1月前
|
监控 测试技术
SAP 电商云修改 Product Catalog Staged 版本数据后,同步到 online 版本的 UI 操作
SAP 电商云修改 Product Catalog Staged 版本数据后,同步到 online 版本的 UI 操作
|
1月前
|
存储 安全 数据管理
SAP S4HANA 数据归档流程详解
SAP S4HANA 数据归档流程详解
|
1月前
|
存储 数据采集 监控
如何在 SAP S4HANA 中使用 Data Volume Management 工具来确定哪些数据需要归档
如何在 SAP S4HANA 中使用 Data Volume Management 工具来确定哪些数据需要归档
|
1月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
|
1月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
|
1月前
|
Web App开发 数据采集 前端开发
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
|
1月前
|
XML 存储 数据格式
SAP UI5 控件 customData 属性的应用介绍
SAP UI5 控件 customData 属性的应用介绍
|
1月前
|
前端开发 JavaScript API
SAP UI5 sap.ui.require.toUrl 的作用介绍
SAP UI5 sap.ui.require.toUrl 的作用介绍