SAP ABAP - Auto Refresh Using ABAP Timer
*&---------------------------------------------------------------------*
*& Report ZTIMER*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZTIMER.
PARAMETERS : P_TIME TYPE T DEFAULT 500.
CLASS CTIMER DEFINITION.
PUBLIC SECTION.
METHODS : RUN_HANDLER FOR EVENT FINISHED OF CL_GUI_TIMER.
ENDCLASS.
DATA TIMER TYPE REF TO CL_GUI_TIMER.
DATA STIMER TYPE REF TO CTIMER.
CLASS CTIMER IMPLEMENTATION.
METHOD RUN_HANDLER.
CALL METHOD TIMER->RUN.
CALL METHOD CL_GUI_CFW=>SET_NEW_OK_CODE
EXPORTING
NEW_CODE = 'REFR'.
ENDMETHOD.
ENDCLASS.
AT SELECTION-SCREEN OUTPUT.
P_TIME = P_TIME - 10.
CREATE OBJECT TIMER.
CREATE OBJECT STIMER.
TIMER->INTERVAL = '10'.
CALL METHOD TIMER->RUN.
SET HANDLER STIMER->RUN_HANDLER FOR ALL INSTANCES.
Comments
Post a Comment