Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

progress bar indicator

Former Member
0 Likes
805

Hi,

Can any one provide me the code for displaying the progress bar indicator

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
761

Hi,

REPORT ZGUIBAR.

DATA: A LIKE SY-UCOMM.

DO 100 TIMES.

DO 300 TIMES.

GET TIME.

ENDDO.

A(3) = SY-INDEX.A+3 = '%'.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

PERCENTAGE = SY-INDEX

TEXT = A.

ENDDO.

Reward if helpfull..

Vasavi.

5 REPLIES 5
Read only

Former Member
0 Likes
761

Hi,

data : TEXT type string value 'Program is Running'.
 CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'                EXPORTING                                          
        TEXT =  text.

Regards,

Morris Bond.

Reward Points if Helpful.

Read only

abapdeveloper20
Contributor
0 Likes
761

Hi Biju,

The below code helps you to create in two differnt ways..

Use this.

1.

DATA : LENGTH TYPE I.
  DATA: V_STRING TYPE STRING.

  DESCRIBE TABLE ITAB LINES LENGTH.

  DO LENGTH TIMES.
    V_STRING = SY-INDEX.
    CONCATENATE V_STRING ' records selected ' INTO V_STRING
    SEPARATED BY SPACE.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = SY-INDEX
              TEXT       = V_STRING.
  ENDDO.

2.

DO 4 TIMES.
    INDEX = SY-INDEX * 25.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
     PERCENTAGE = INDEX
     TEXT       = 'Please wait while ARE1 Number is Generating........'.
    WAIT UP TO 1 SECONDS.
  ENDDO.

Reward points if useful

~Lakshmiraj~

Read only

Former Member
0 Likes
762

Hi,

REPORT ZGUIBAR.

DATA: A LIKE SY-UCOMM.

DO 100 TIMES.

DO 300 TIMES.

GET TIME.

ENDDO.

A(3) = SY-INDEX.A+3 = '%'.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

PERCENTAGE = SY-INDEX

TEXT = A.

ENDDO.

Reward if helpfull..

Vasavi.

Read only

uwe_schieferstein
Active Contributor
0 Likes
761

Hello Biju

If I process a list of records I use the following coding:


DATA: ld_text(50)        type c.
DATA: ld_count           type i.
DATA: ld_perc             type i.

DESCRIBE TABLE gt_outtab.  " fills sy-tfill
ld_count = syst-tfill.

LOOP AT gt_outtab INTO ls_outtab.

  ld_perc = ( syst-tabix * 100 ) / ld_count.
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      percentage = ld_perc
      text           = ld_text.
...
ENDLOOP.

Regards

Uwe

Read only

Clemenss
Active Contributor
0 Likes
761

Hi Biju,

You may use below form routine. There is the small advantage that you can call it

to display a text only

PERFORM sapgui_progress_indicator USING 'Here comes my text' 0 0.

or with a progress indication i.e. in a loop

PERFORM sapgui_progress_indicator USING 'progress' sy-tabix sy-tfill.

It will no display more often than once per second, so yourt program will not slow down.


*&---------------------------------------------------------------------*
*&      Form  SAPGUI_PROGRESS_INDICATOR
*&---------------------------------------------------------------------*
form sapgui_progress_indicator
  using
  p_text                                  type c
  p_share                                 type sytfill
  p_total                                 type sytfill.
  statics:
    lv_time                               like sy-uzeit,
    lv_txt                                type text80.
  data:
    lv_seconds_since_lastcall             type sytfill,
    lv_share                              type p,
    lv_pct                                type sytfill,
    lv_txt1                               type tline-tdline,
    lv_txt2                               type tline-tdline.
  get time.
  lv_seconds_since_lastcall               = sy-uzeit - lv_time.
  check lv_seconds_since_lastcall         >= 1 or lv_txt <> p_text.
  lv_txt                                  = p_text.
  lv_time                                 = sy-uzeit.
  if p_total                              > 0.
    lv_share                              = p_share.
    lv_share                              = p_share.
    lv_pct                                = lv_share * 100 / p_total.
    write p_share to lv_txt1 left-justified.
    write p_total to lv_txt2 left-justified.
    concatenate
      p_text lv_txt1 '/' lv_txt2 into lv_txt1 separated by space.
    call function 'SAPGUI_PROGRESS_INDICATOR'
      exporting
        percentage = lv_pct
        text       = lv_txt1.
  else.
    call function 'SAPGUI_PROGRESS_INDICATOR'
         exporting
*             percentage                  = lv_pct
              text                        = p_text.
  endif.                               " p_total > 0.
endform.                               " SAPGUI_PROGRESS_INDICATOR

Regards,

Clemens