如何动态修改SAP CRM WebClient UI表格栏的宽度
2023-09-14 09:02:45 时间
Achievement
By clicking down or up button, the table width could be changed dynamically - each time the button is clicked,
the width increases or shrinks at 10 px interval.
(1) Create a table view with toolbar defined:
(2) Create the attribute gt_toolbar_button in controller class:
Define the on click handling logic for button DOWN and UP:
(3) Create two event handler for DOWN and UP:
method EH_ONDOWN.
change( iv_up = abap_false ).
endmethod.
method EH_ONUP.
change( iv_up = abap_true ).
endmethod.
The implementation of change method:
method CHANGE.
CALL METHOD me->configuration_descr->get_config_data
RECEIVING
rv_result = DATA(lv_xml)
EXCEPTIONS
config_not_found = 1.
CHECK sy-subrc = 0.
DATA(ls_config_data) = cl_bsp_dlc_table_utility=>conf_xml_to_abap( lv_xml ).
LOOP AT ls_config_data-columndefinition ASSIGNING FIELD-SYMBOL(<column>).
<column>-width = GET_WIDTH( iv_up = iv_up iv_old_value = <column>-width ).
ENDLOOP.
DATA(lv_xml_changed) = cl_bsp_dlc_table_utility=>conf_abap_to_xml( ls_config_data ).
DATA(lr_configuration2) = CAST if_bsp_dlc_config_table_layout( me->configuration_descr ).
lr_configuration2->set_active_table_layout( iv_config_data = lv_xml_changed ).
endmethod.
The implementation of get_width method:
method GET_WIDTH.
DATA lv_new TYPE i.
DATA lv_temp TYPE string.
lv_temp = iv_old_value.
REPLACE ALL OCCURRENCES OF 'px' IN lv_temp WITH space.
CONDENSE lv_temp NO-GAPS.
lv_new = lv_temp.
IF iv_up = abap_true.
lv_new = lv_new + 10.
ELSE.
lv_new = lv_new - 10.
ENDIF.
lv_temp = lv_new.
value = lv_temp && 'px'.
CONDENSE value NO-GAPS.
endmethod.
Signature of these two methods:
methods CHANGE
importing
!IV_UP type ABAP_BOOL .
methods GET_WIDTH
importing
!IV_OLD_VALUE type STRING
!IV_UP type ABAP_BOOL
returning
value(VALUE) type STRING .
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- SAP UI5 sap.ui.core.Element 的概要介绍
- SAP Commerce Cloud 里 OAuth2 Client 的两种配置方法
- SAP UI5 sap.ui.layout.Grid 控件宽度百分比的设置原理
- SAP UI5 sap.ui.base.ManagedObject 的构造函数参数讲解
- 使用 SAP UI5 sap.ui.export.Spreadsheet API 进行 Excel 导出的一些限制
- SAP 电商云 Spartacus UI External Route 的模块实现概述
- UI自动化平台_ui自动化是什么意思
- SAP UI5 Smart Chart 功能介绍
- 160. 如何根据 SAP Fiori UI 界面上的错误消息,找到后台 ABAP 对应的消息 ID
- SAP Fiori 3 的 Quartz Theme 在 WebClient UI 和 SAPGUI 中的应用
- SAP UI5 sap.m.Table 实现响应式布局的两种配置模式
- sap.ui.core.Configuration 的作用简析
- SAP通过程序创建Excel模板详解编程语言
- SAP Smartform中table和template的区别详解编程语言
- 全部SAP转储订单(STO)详解编程语言
- SAP在Linux上安装(sap安装linux)
- 调用SAP接口:MSSQL实现自动化(mssql调用sap接口)
- 缓存使用SAP创建Redis缓存,实现高效稳定加速(sap如何创建redis)
- 对比Oracle和SAP价格比较哪个是更值得投入的选择(oracle与sap价格)