DATA:lv_cnt TYPE i.
DATA:lv_total TYPE i.
SELECT * FROM hrp1000 INTO TABLE @DATA(lt_hrp1000) .
DESCRIBE TABLE lt_hrp1000 LINES lv_total.
LOOP AT lt_hrp1000 ASSIGNING FIELD-SYMBOL(<fs>).
lv_cnt = lv_cnt + 1.
PERFORM frm_process_indicator USING lv_cnt lv_total 'Processing...'.
ENDLOOP.
FORM frm_process_indicator USING p_lv_cnt
p_lv_total
VALUE(p_text).
DATA:lv_text(50) TYPE c.
DATA:lv_idx(3) TYPE n.
lv_idx = ( p_lv_cnt / p_lv_total ) * 100.
lv_text = lv_idx && '%' && p_text.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = lv_idx
text = lv_text
EXCEPTIONS
OTHERS = 0.
ENDFORM.
CASE r_ucomm.
WHEN 'RUN'.
PERFORM frm_set_indicator USING TEXT-t02. "正在导入,请稍等...
ENDCASE.
FORM frm_set_indicator USING p_text_t01.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = p_text_t01. "text for process
ENDFORM.