让ABAP ALV响应事件
2008 12 31 04:25 PM 2170次查看
分类:ABAP 标签:无
下面给个例子
form start_list_viewer.
data: wa_events type slis_alv_event,
lt_events type slis_t_event.
* Make events table
wa_events-name = 'TOP_OF_PAGE'.
wa_events-form = 'STANDARD_HEADER'.
append wa_events to lt_events.
wa_events-name = 'END_OF_LIST'.
wa_events-form = 'STANDARD_FOOTER'.
append wa_events to lt_events.
* Display in ALV List
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
it_fieldcat = gt_fieldcat[]
it_events = lt_events[]
tables
t_outtab = gt_ooxx[]
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
* message id sy-msgid type sy-msgty number sy-msgno
* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform.
这里的TOP_OF_PAGE和END_OF_LIST就是事件名,STANDARD_HEADER和STANDARD_FOOTER是自定义的form,里面可以用write输出一些信息。顺便说下,如果是ALV Grid的话,有个I_GRID_TITLE参数可以定义表格的标题。
0条评论 你不来一发么↓