有时候需要在双击ALV某行时,弹出一个窗口
这里介绍中比较简单的实现方式:FM: REUSE_ALV_POPUP_TO_SELECT
CALL FUNCTION ‘REUSE_ALV_POPUP_TO_SELECT’
EXPORTING
i_title = ‘凭证明细’ “弹出的alv标题
i_zebra = ‘X’
i_screen_start_column = 10 “ALV起始位置
i_screen_start_line = 10
i_screen_end_column = 115
i_screen_end_line = 15
i_tabname = space “这里默认是空就OK了
it_fieldcat = fieldcat[] “这里是字段目录
TABLES
t_outtab = l_it_detial[] .
实例如下:
DATA:l_alvexit TYPE c.
DATA:wa_selfield TYPE slis_selfield.
DATA:li_fieldcat TYPE slis_t_fieldcat_alv.
DATA:wa_fieldcat TYPE slis_fieldcat_alv.
wa_fieldcat-fieldname = 'ICON'.
wa_fieldcat-seltext_l = 'STATUS'.
wa_fieldcat-outputlen = '6'.
wa_fieldcat-icon = 'X'.
APPEND wa_fieldcat TO li_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AUFNR'.
wa_fieldcat-seltext_l = '订单号'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO li_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ROW'.
wa_fieldcat-seltext_l = '行号'.
wa_fieldcat-outputlen = '5'.
APPEND wa_fieldcat TO li_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MESSAGE'.
wa_fieldcat-seltext_l = '消息文本'.
wa_fieldcat-outputlen = '60'.
APPEND wa_fieldcat TO li_fieldcat.
CLEAR wa_fieldcat.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
* I_TITLE =
* I_SELECTION = 'X'
* I_ZEBRA = ' '
* I_CHECKBOX_FIELDNAME =
* I_CHECKBOX_FIELDNAME =
i_tabname = 'I_MESSAGE'
it_fieldcat = li_fieldcat[]
* IMPORTING
* ES_SELFIELD = WA_SELFIELD
* E_EXIT = L_ALVEXIT
TABLES
t_outtab = i_message
EXCEPTIONS
program_error = 1
OTHERS = 2
.
版权声明:本文为Hi_wakeup原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。