ABAP实现屏幕自己刷新和跳转功能


 1   SET TITLEBAR ' 屏幕自动程序'.
 2 
 3   IF g_contine_no IS INITIAL.
 4     CREATE OBJECT gr_timer.
 5     CREATE OBJECT gr_app_timer.
 6     SET HANDLER gr_app_timer->handle_get_brgew FOR gr_timer.
 7 
 8     "0.5S 刷新一次
 9     gr_timer->interval = '0.5'.
10     CALL METHOD gr_timer->run.
11 
12     "计数器,刷新6次获取重量
13     g_count = g_count + 1.
14     IF g_count GE 6.
15       g_contine_no = 'X'.
16       "停止刷新标识
17       g_refresh_no = 'X'.
18     ENDIF.
19   ENDIF.
20 
21   IF  sy-ucomm <> 'ENTER'.
22     CREATE OBJECT gr_timer.
23     CREATE OBJECT gr_app_timer.
24     SET HANDLER gr_app_timer->handle_callback FOR gr_timer.
25     gr_timer->interval = '1'.
26     CALL METHOD gr_timer->run.
27   ENDIF.