REUSE_ALV_POPUP_TO_SELECT的使用技巧

通过函数的方法弹出一个对话框,提供选择数据的功能……

 DATA: BEGIN OF lt_exidv OCCURS ,
box TYPE char1,
exidv TYPE exidv,
status TYPE char4,
END OF lt_exidv.
DATA: lt_fieldcat TYPE slis_t_fieldcat_alv,
lh_fieldcat TYPE LINE OF slis_t_fieldcat_alv.
DATA:l_message(),l_line. lt_exidv-exidv = ''.
lt_exidv-status = ''.
APPEND lt_exidv.
lt_exidv-exidv = ''.
lt_exidv-status = ''.
APPEND lt_exidv.
lt_exidv-exidv = ''.
lt_exidv-status = ''.
APPEND lt_exidv. IF lt_fieldcat[] IS INITIAL.
CLEAR lh_fieldcat.
lh_fieldcat-fieldname = 'EXIDV'.
lh_fieldcat-seltext_l = '箱码'.
lh_fieldcat-outputlen = .
APPEND lh_fieldcat TO lt_fieldcat[].
* CLEAR lh_fieldcat.
* lh_fieldcat-fieldname = 'STATUS'.
* lh_fieldcat-seltext_l = '箱状态'.
* lh_fieldcat-outputlen = .
* APPEND lh_fieldcat TO lt_fieldcat[].
ENDIF. CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
* I_TITLE =
* I_SELECTION = 'X'
* I_ALLOW_NO_SELECTION =
i_zebra = 'X'
* I_SCREEN_START_COLUMN =
* I_SCREEN_START_LINE =
* I_SCREEN_END_COLUMN =
* I_SCREEN_END_LINE =
i_checkbox_fieldname = 'BOX'
* I_LINEMARK_FIELDNAME =
* I_SCROLL_TO_SEL_LINE = 'X'
i_tabname = 'LT_EXIDV'
* I_STRUCTURE_NAME =
it_fieldcat = lt_fieldcat[]
* IT_EXCLUDING =
* I_CALLBACK_PROGRAM =
* I_CALLBACK_USER_COMMAND =
* IS_PRIVATE =
* IMPORTING
* ES_SELFIELD =
* E_EXIT =
TABLES
t_outtab = lt_exidv
EXCEPTIONS
program_error =
OTHERS = .
IF sy-subrc <> .
* CALL FUNCTION 'MESSAGE_TEXT_BUILD'
* EXPORTING
* msgid = sy-msgid
* msgnr = sy-msgno
* msgv1 = sy-msgv1
* msgv2 = sy-msgv2
* msgv3 = sy-msgv3
* msgv4 = sy-msgv4
* IMPORTING
* message_text_output = l_message.
* MESSAGE l_message TYPE 'E'.
ELSE.
LOOP AT lt_exidv WHERE box = 'X'.
l_line = sy-tabix.
CONCATENATE l_message '您选中的有第' l_line '行...' INTO l_message.
ENDLOOP.
MESSAGE l_message TYPE 'I'.
ENDIF.

弹出的DIALOG示例:

REUSE_ALV_POPUP_TO_SELECT的使用技巧REUSE_ALV_POPUP_TO_SELECT的使用技巧

上一篇:Bash 小知识点


下一篇:Hibernate一 入门