-
프로그레스바 진행률 표시SAP/ABAP 2013. 3. 19. 09:14
*&---------------------------------------------------------------------*
*& Report Z_PROGRESS_BAR *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT Z_PROGRESS_BAR .
DATA : GV_WK_CNT TYPE I,
GV_WK_TOTAL TYPE I,
GV_WK_DISP_CNT TYPE I,
GV_WK_DISP_MAX TYPE I VALUE 1000.
CONSTANTS : GC_TOTAL_TIME TYPE I VALUE 30.
START-OF-SELECTION.
PERFORM INIT_PROGRESS_BAR USING GC_TOTAL_TIME.
DO GC_TOTAL_TIME TIMES.
PERFORM DISP_PROGRESS_BAR USING 'ING..' SY-TABIX.
WAIT UP TO 1 SECONDS.
ENDDO.
*---------------------------------------------------------------------*
* Form INIT_PROGRESS_BAR
*---------------------------------------------------------------------*
FORM INIT_PROGRESS_BAR USING P_TOTAL.
CLEAR : GV_WK_CNT, GV_WK_TOTAL.
GV_WK_TOTAL = P_TOTAL.
ENDFORM. " INIT_PROGRESS_BAR
*---------------------------------------------------------------------*
* Form disp_progress_bar
*---------------------------------------------------------------------*
FORM DISP_PROGRESS_BAR USING P_TITLE
P_CNT.
DATA: GV_WK_GUI_MSG(100),
GV_WK_PERCENT TYPE I,
GV_WK_TEXT1(15),
GV_WK_TEXT2(15).
GV_WK_CNT = GV_WK_CNT + 1.
GV_WK_DISP_CNT = GV_WK_DISP_CNT + 1.
CHECK GV_WK_DISP_CNT >= P_CNT.
CLEAR GV_WK_DISP_CNT.
GV_WK_PERCENT = GV_WK_CNT * 100 / GV_WK_TOTAL.
CLEAR GV_WK_GUI_MSG.
GV_WK_GUI_MSG+0(3) = GV_WK_PERCENT.
GV_WK_GUI_MSG+3(1) = '%'.
WRITE GV_WK_CNT TO GV_WK_TEXT1 UNIT 'PC'.
WRITE GV_WK_TOTAL TO GV_WK_TEXT2 UNIT 'PC'.
CONDENSE GV_WK_TEXT1 NO-GAPS.
CONDENSE GV_WK_TEXT2 NO-GAPS.
CONCATENATE GV_WK_GUI_MSG P_TITLE
'(' GV_WK_TEXT1 ' / ' GV_WK_TEXT2 ')'
INTO GV_WK_GUI_MSG SEPARATED BY ' '.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = GV_WK_PERCENT
TEXT = GV_WK_GUI_MSG.
ENDFORM. " DISP_PROGRESS_BAR'SAP > ABAP' 카테고리의 다른 글
심플한 필드카달로그 - 매크로버전 (1) 2013.03.21 서치헬프 강제생성(헤더 변경 포함) (0) 2013.03.20 셀렉션 스크린에 버튼달기 (0) 2013.03.19 프로그램 소스 직접 수행 (0) 2013.03.11 SAP Query 수정 후 반영 (0) 2011.12.07