SAP ABAP Webdynpro ALV的link to action的实现方法

简介: SAP ABAP Webdynpro ALV的link to action的实现方法

If you include the standard webdynpro ALV component SALV_WD_TABLE into your own component, you could not directly change the ALV table column as usual. In ABAP Webdynpro an example of link to action element used in ALV looks like below. Once the column “Social Media Post ID” is clicked, it is expected our application could catch the event and implement our own event handling logic.


image.png

You could follow the steps below:


(1) Define the component usage to ALV component by double clicking your webdynpro component in SE80 and maintain the component usage in tab “Used Web Dynpro Components”


image.png

(2) Double click the INTERFACECONTROLLER_USAGE,add your own component for ALVcomponent usage. The reason for this is you need to map the context node of your own component to ALV component, so that it can know which data from your application should display.


image.png

After that it is ready for mapping the context node of your component to the context node DATA of ALV component. You can achieve it via drag and drop or right click on DATA node, and choose “Define External Mapping” from context menu. After mapping is done, you could see the mapping path displayed below.

image.png

(3) double click on your view, and insert a new element “ViewContainerUIElement”, which acts as the container for ALV interface view to be embedded.

image.png

then double click on window, right click the ViewContainerUIElement and choose “Embed View”, include the ALV interface view from drop down list.


image.png

The final settings looks like below. Now you should already see the ALV in your application UI.

image.png

Create a new method in view controller and implement the code below:

image.png

And call it in wddomodifyview of view controller:

image.png

Note: according to sap help, the event ON_CLICK is only triggered if the method

IF_SALV_WD_TABLE_SETTINGS~SET_CELL_ACTION_EVENT_ENABLED is set to FALSE Otherwise, the event ON_CELL_ACTION is triggered.

(4) Create a event handler in view controller Methods tab. Choose the event name ON_CLICK from drop down list.

image.png

In the runtime, the selected item index and item value could be found in importing parameter R_PARAM:

image.png


相关文章
|
4月前
|
存储 安全 数据库
什么是 SAP ABAP 数据库表的 Display Maintenance Allowed with Restrictions
什么是 SAP ABAP 数据库表的 Display Maintenance Allowed with Restrictions
|
4月前
|
安全 API 数据库
SAP ABAP OData 中 Function import 的概念介绍
SAP ABAP OData 中 Function import 的概念介绍
|
4月前
|
SQL 负载均衡 监控
SAP ABAP DBSQL_SQL_ERROR 错误
SAP ABAP DBSQL_SQL_ERROR 错误
|
4月前
|
前端开发 数据库 开发者
如何在 SEGW 事务码里为 SAP ABAP OData 服务实现 Function Import 试读版
如何在 SEGW 事务码里为 SAP ABAP OData 服务实现 Function Import 试读版
SAP ABAP OData 服务里需要指定 guid 类型的请求参数时,正确语法是什么?
SAP ABAP OData 服务里需要指定 guid 类型的请求参数时,正确语法是什么?
|
4月前
|
SQL 监控 Oracle
SAP ABAP 系统错误 Return value of the database layer SQL dbsl rc 99
SAP ABAP 系统错误 Return value of the database layer SQL dbsl rc 99
|
4月前
|
存储 前端开发 Linux
在 SAP ABAP 系统里访问 FTP 服务器
在 SAP ABAP 系统里访问 FTP 服务器
|
4月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
|
4月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
|
4月前
|
Web App开发 数据采集 前端开发
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版