Dynamic Progress Indicator


This code provides user awareness about progress percentages.

Result:

 1

Code:

 

report  zanil   .

* SAP Progress BAR Example

data lt_bkpf       type table of bkpf      .

data ls_bkpf       type bkpf               .

data lv_lines      type i                  .

data lv_per        type i                  .

data dynamic_per   type p                  .

data lv_dy_per(3)                          .

data lv_text(40)                           .

startofselection.

  select from bkpf into table lt_bkpf   .

  describe table lt_bkpf lines lv_lines   .

  loop at lt_bkpf into ls_bkpf.

    wait up to seconds.

    clear dynamic_per.

    dynamic_per 100 sytabix / lv_lines ).

    lv_dy_per dynamic_per.

    shift lv_dy_per left deleting leading ‘ ‘.

    concatenate lv_dy_per ‘% Completed’ into lv_text.

    if dynamic_per gt lv_per or sytabix eq 1.

    call function ‘SAPGUI_PROGRESS_INDICATOR’

      exporting

        percentage dynamic_per

        text       lv_text.

    lv_per dynamic_per.

    endif.

  endloop.

Leave a comment

Your email address will not be published. Required fields are marked *