Hello Friends,
A Progress bar is used in situations where the extent of the task is
unknown or the progress of the task cannot be
determined in a way that could be expressed as a percentage.
As I am giving sample code for the mentioned subject line.
Sample Code : (fetch data from database table)
____________________________________________
data : bsegit type table of bseg with header line,
bsegwa type bseg.
DATA: percentage_text TYPE c LENGTH 5.
data : cnt type i.
data : perc type i.
select * from bseg into bsegwa up to 10000 rows.
cnt = cnt + 1.
if cnt = 100.
perc = perc + 1.
percentage_text(3) = perc ." sy-index.
percentage_text+3 = '%'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = perc "sy-index
text = percentage_text.
cnt = 0.
endif.
write : / bsegwa-belnr.
endselect.
Note : When you are not sure about the number of records then count the records, trace out % and perform further operation.
_____________________________________________
SAP Help Ref. :
_____________________________________________
DATA: percentage_text TYPE c LENGTH 5.
DO 100 TIMES.
WAIT UP TO '0.5' SECONDS.
percentage_text(3) = sy-index.
percentage_text+3 = '%'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = sy-index
text = percentage_text.
ENDDO.
_____________________________________________
Thanks
Avirat Patel