SAPGUI_PROGRESS_INDICATOR - %

SAP/ABAP 개발 2010. 7. 19. 11:48 Posted by KindKay



 *&----------------------------------------------------------------*
*& Report  YRTEST0034
*&
*&----------------------------------------------------------------*
*&
*&
*&----------------------------------------------------------------*

REPORT  YRTEST0034.

  include YRTEST0034top.
  include YRTEST0034f01.



*-----------------------------------------------------------------*
start-of-selection.
*-----------------------------------------------------------------*
  select *
    into corresponding fields of table gt_itab2
    from sflight.

  clear: gt_itab[], gt_itab.

  loop at gt_itab2.
    do 10000 times.
      move-corresponding gt_itab2 to gt_itab.
      append gt_itab.
    enddo.
  endloop.

*-----------------------------------------------------------------*
end-of-selection.
*-----------------------------------------------------------------*
  data: l_total type i.
  describe table gt_itab lines l_total.
  loop at gt_itab.
    l_totcnt  = l_totcnt + 1.
    l_totcnt2 = l_totcnt mod 10.
    if l_totcnt2 = 0.
      g_rate = sy-tabix / l_total * 100.
      perform display_rate.
    endif.
  endloop.

  write: 'End'.
 



*&----------------------------------------------------------------*
*&  Include           YRTEST0034F01
*&----------------------------------------------------------------*

*&----------------------------------------------------------------*
*&      Form  DISPLAY_RATE
*&----------------------------------------------------------------*
*       text
*-----------------------------------------------------------------*
form display_rate .

  data: l_text(50).

  concatenate g_rate '%' 'progressing ->' gt_itab-carrid
         into l_text separated by space.

  call function 'SAPGUI_PROGRESS_INDICATOR'  "Progress  Bar
    exporting
      percentage = g_rate
      text       = l_text      "
    exceptions
      others     1.

endform.                    " DISPLAY_RATE