abap - 在 SALV 全屏上启用/禁用按钮的问题
问题描述
亲爱的,我在下面迫切需要你的帮助。
我从 SALV 创建了一个 ALV,并SALV_STANDARD
从标准程序复制了一个 GUI 状态。首先,我添加了 POSTNEW 和 POSTDIFF 两个按钮,一天后我添加了SELECT按钮。
根据用户的选择,我想根据业务需求启用或禁用按钮。
我在一个过程中有这个代码:
r_alv type reference CL_SALV_TABLE.
if status_name is not initial and report_name is not initial.
set pf-status status_name.
r_alv->set_screen_status(
pfstatus = status_name
report = report_name
set_functions = r_alv->c_functions_all ).
endif.
data: lit_functions_list type salv_t_ui_func,
lwa_functions_list like line of lit_functions_list.
r_functions = r_alv->get_functions( ). "Get Toolbar functions
lit_functions_list = r_functions->get_functions( ).
if i_button_name is not initial.
** Now hide the BUTTON
loop at lit_functions_list into lwa_functions_list.
if lwa_functions_list-r_function->get_name( ) = i_button_name.
lwa_functions_list-r_function->set_visible( i_button_visable ).
endif.
endloop.
endif.
变量status_name
、和是过程的参数report_name
,我认为它们的名称显示了它们所携带的内容。 i_button_name
i_button_visable
The internal table lit_functions_list has 60 records and the last 2 have data for the first 2 buttons and this is the reason that I can enable/disable them.
But there is no record with my 3rd button SELECT. Instead there is a record with the button MYFUNCTION which I have already deleted.
Can someone tell me what to do in order to have the 3rd button available in the lit_functions_list?
Can someone tell me why this itab has so many garbages?
Thanks in advance
Elias
解决方案
即使我有同样的问题。在我运行报告 BALVBUFDEL 后,它解决了这个问题。
新创建的按钮现在进入功能列表..
lit_functions_list = r_functions->get_functions( ).
推荐阅读
- javascript - 在我放入一个无法自行运行的新函数后,整个 JS 文件无法运行
- javascript - 如何获取循环值
- java - 如何使用 feign 客户端反序列化 application/json+hal 消息?
- file - UNIX Shell:else 部分中的代码不会执行,但会检查条件
- c# - Roslyn 是 Visual Studio 2017 的默认编译器吗
- c - 使用 mpicc 编译非 mpi 库
- r - 通过分配 LCC 投影将矩阵转换为栅格
- python - 从 python2.6.6 版本的位置导入熊猫
- node.js - 如何在使用 validator.js 检查 .isAlpha 时包含许多语言环境
- java - 我正在尝试按日期过滤文件