DATA: g_total TYPE i,
g_cnt TYPE i,
g_index TYPE i.
DATA: gt_sflight TYPE TABLE OF sflight WITH HEADER LINE.
START-OF-SELECTION.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE gt_sflight
FROM sflight.
DESCRIBE TABLE gt_sflight LINES g_total.
LOOP AT gt_sflight.
g_cnt = g_cnt + 1.
PERFORM process_indicator USING g_cnt g_total 'PROCESSING...'.
ENDLOOP.
WRITE 'SUCCESS'.
FORM process_indicator USING VALUE(p_cur)
VALUE(p_total)
VALUE(p_text).
DATA:lv_text(50) TYPE c,
lv_idx(3) TYPE n.
lv_idx = ( p_cur / p_total ) * 100.
CONCATENATE lv_idx '%:' p_text INTO lv_text.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = lv_idx
text = lv_text
EXCEPTIONS
OTHERS = 0.
ENDFORM.
沙计时器-进度条
于 2022-04-21 15:32:36 首次发布