gui 刷新
http://blog.csdn.net/zjut_xiongfeng/article/details/4588832
REPORT z04_gui_timer.
CLASS lcl_event_handler DEFINITION DEFERRED.
DATA: go_timer TYPE REF TO cl_gui_timer,
go_evt_hndl TYPE REF TO lcl_event_handler,
gt_spfli TYPE TABLE OF spfli WITH HEADER LINE.
*&---------------------------------------------------------------------*
*& START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.
SELECT * INTO TABLE gt_spfli
FROM spfli UP TO 30 ROWS.
PERFORM list_output.
PERFORM init_timer.
*&---------------------------------------------------------------------*
*& USER-COMMAND
*&---------------------------------------------------------------------*
AT USER-COMMAND.
IF sy-ucomm = 'RFSH'.
sy-lsind = sy-lsind - 1.
PERFORM list_output.
ENDIF.
*&---------------------------------------------------------------------*
*& Form LIST_OUTPUT
*&---------------------------------------------------------------------*
FORM list_output.
DATA: ls_spfli LIKE LINE OF gt_spfli.
NEW-PAGE WITH-TITLE LINE-SIZE 60.
WRITE: /5 'CARRID', AT 30 'CONNID'.
LOOP AT gt_spfli.
WRITE: / gt_spfli-carrid UNDER 'CARRID',
gt_spfli-connid UNDER 'CONNID'.
ENDLOOP.
ENDFORM. " LIST_OUTPUT
*&---------------------------------------------------------------------*
*& CLASS lcl_event_handler DEFINITION
*&---------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
handle_timer FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "lcl_event_handler DEFINITION
*&---------------------------------------------------------------------*
*& CLASS lcl_event_handler IMPLEMENTATION
*&---------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION.
METHOD handle_timer.
DELETE gt_spfli INDEX 1.
* SET USER-COMMAND 'RFSH'.
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'RFSH'.
CALL METHOD go_timer->run "必须重新激活定时器
EXCEPTIONS
OTHERS = 9.
ENDMETHOD. "handle_timer
ENDCLASS. "lcl_event_handler IMPLEMENTATION
*&---------------------------------------------------------------------*
*& Form INIT_TIMER
*&---------------------------------------------------------------------*
FORM init_timer.
CHECK go_timer IS INITIAL.
CREATE OBJECT go_timer
EXCEPTIONS
OTHERS = 9.
CREATE OBJECT go_evt_hndl.
SET HANDLER go_evt_hndl->handle_timer FOR go_timer.
go_timer->interval = 3. "设置间隔为3秒
CALL METHOD go_timer->run "激活定时器
EXCEPTIONS
OTHERS = 9.
ENDFORM. " INIT_TIMER
weiUI 刷新
<%@page language="abap" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="crm_bsp_ic" prefix="crmic" %>
<%@extension name="bsp" prefix="bsp" %>
id =
"evid"
name =
"triggerServerEvent" />
阅读(2441) | 评论(0) | 转发(1) |