显示进度条
*显示进度条
FORM process_status .
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = 10
text = '数据处理中,请稍候......'.
ENDFORM. "process_status
l_text TYPE c LENGTH 105,
l_text_tmp TYPE c LENGTH 100,
l_per_c TYPE c LENGTH 3.
CONCATENATE l_text_tmp
' >'
INTO l_text_tmp
.
l_per_c = l_per.
CONCATENATE l_per_c
'% '
l_text_tmp
INTO l_text
.
CALL FUNCTION
'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = 100
text
=
l_text.
l_per = l_per + 1.
FORM
ENDFORM.
例:
REPORT zlm_test_sgui_.
DATA: l_per TYPE i,
DO 100 TIMES.
ENDDO.
例二:
*&---------------------------------------------------------------------*
*&Report ZLM_TEST03
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZLM_TEST03.
DATA: I_PROG TYPE I,
I_PROG2 TYPE I.
START-OF-SELECTION.
DO 100 TIMES .
DO 100000 TIMES.
I_PROG2 = I_PROG2 + 1.
ENDDO.
I_PROG = I_PROG + 1.
WRITE: / '第' NO-GAP , I_PROG NO-GAP , '次运行:',I_PROG2.
PERFORM SCHEDULE USING '' I_PROG.
ENDDO.
*&--------------------------------------------------------------------*
*& Form schedule
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->C_MESSAGE text
* -->I_PERCENT text
*---------------------------------------------------------------------*
FORM SCHEDULE USING
C_MESSAGE TYPE C
I_PERCENT TYPE I.
DATA: C_SCHE(204).
IF I_PERCENT <= 0 OR I_PERCENT > 100 .
C_SCHE = '百分比错误!!!'.
ELSE.
DATA: C_PERCENT(4),
C_BLOCK(6) TYPE C VALUE '■■',
I_BLOCKLEN TYPE I,
I_COUNT TYPE I,
I_COL TYPE I,
I_LEN TYPE I,
I_TEMP TYPE I VALUE 0,
I_MOD TYPE I.
I_BLOCKLEN = STRLEN( C_BLOCK ).
C_PERCENT = I_PERCENT.
CONDENSE C_PERCENT.
C_PERCENT+3(1) = '%'.
C_SCHE = C_PERCENT.
I_COUNT = I_PERCENT / 4.
DO I_COUNT TIMES.
I_COL = ( I_TEMP * I_BLOCKLEN ) + 4.
C_SCHE+I_COL(I_BLOCKLEN) = C_BLOCK.
I_TEMP = I_TEMP + 1.
ENDDO.
I_LEN = STRLEN( C_MESSAGE ).
I_MOD = I_LEN MOD 2.
IF
*&
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT
DATA:
START-OF-SELECTION.
*&--------------------------------------------------------------------*
*&
*&--------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
*
*
*---------------------------------------------------------------------*
FORM