‎2009 Jan 22 2:37 PM
Dear All
Can you please help me with code which shows the progress bar movement until the loop is finished.
Thank you in advance
Regards
William
‎2009 Jan 22 4:01 PM
Hi,
You can do it using Function SAPGUI_PROGRESS_INDICATOR.
Try this, it will surely help you.
‎2009 Jan 23 6:24 AM
‎2009 Jan 22 4:38 PM
a little more detail
IF sy-dbcnt = cyc_break.
cyc_pct = cyc_pct + 10.
cyc_break = cyc_break + cyc_const.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = cyc_pct
text = 'Building Prospect Information'.
ENDIF.
I do a select COUNT .. to determine max db reads within the loop. then divide by 10 so that the indicator is updated only 10x. Doing it every time through the loop will give you unbelievable bad response time.
‎2009 Jan 22 4:42 PM
I use something like this... assuming i_afpo is the table need to be processed
DATA : lv_per TYPE syst-tabix ,
lv_lst_p TYPE syst-tabix ,
lv_total TYPE syst-tabix ,
lv_char TYPE string .
DESCRIBE TABLE i_afpo LINES lv_total .
LOOP AT i_afpo ASSIGNING <fs_afpo> .
* Progress Indicator
lv_lst_p = ( sy-tabix * 100 ) / lv_total .
* There is no point in updating frontend if % remains same
IF lv_lst_p NE lv_per .
lv_per = lv_lst_p .
lv_char = lv_per .
CONCATENATE 'Processing'(002)
lv_char
'%'(003)
INTO lv_char
SEPARATED BY space .
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = lv_per
text = lv_char.
ENDIF.
ENDLOOP.
‎2009 Jan 23 6:22 AM
Dear Pawan Kesari.
Thank you so much it worked. many thanks to you.
William
‎2009 Jan 23 6:25 AM