Skip to Content
Technical Articles

The progress indicator in ABAP reports

I’m sure most of you have been asked to develop a report displaying a progress indicator during the execution of the report. I just developed a migration report which needs several minutes to execute, so I decided to put in a progress indicator.

When running the ATC check with abapOpenChecks for the report I’ve developed, I got an error telling me that function module SAPGUI_PROGRESS_INDICATOR should not be used. Even though this is documented in the documentation of check 53 for abapOpenChecks, an SAP Knowledge Base Search for information on what should be used instead of function module SAPGUI_PROGRESS_INDICATOR didn’t give me any results. The documentation at abapOpenChecks states that class CL_PROGRESS_INDICATOR should be used instead of the function module. I decided to write this short blog post to share this information with the community as well as to provide a tiny code example.

Instead of using the function module like this:

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
  EXPORTING
    percentage = progress_percent
    text       = progress_text.

 

You can use the class like this:

cl_progress_indicator=>progress_indicate(
    i_text = |Processing: { current_record }/{ total_records }|
    i_output_immediately = abap_true ).

 

The result isn’t exactly the same since the function module only works with percentages. This could easily be achieved with the class as well, but in this case, I was more interested in seeing how many of the total records had been processed.

Happy coding!

This blog post first appeared on the Developer Voyage blog at https://www.developervoyage.com/2019/11/11/the-progress-indicator-in-abap-reports.html

8 Comments
You must be Logged on to comment or reply to a post.
  • For the matter of fact, method cl_progress_indicator=>progress_indicate has a few advantages over FM SAPGUI_PROGRESS_INDICATOR:

    1. It supports also background processing (Writes messages to job log).
    2. It includes also some “load-balancing”, by updating progress bar only every pre-defined time window (10 seconds) instead of updating it on every call (unless parameter I_OUTPUT_IMMEDIATELY=’X’ is set).
    3. Percentage is calculated internally (when you transfer I_PROCESSED, I_TOTAL).
      You must set I_TEXT or I_MSGID/I_MSGNO with 3 message placeholders (&1, &2, &3) so it will work as expected.
  • Its configurable in abapOpenChecks if usage of SAPGUI_PROGRESS_INDICATOR should report errors, but by default abapOpenChecks is quite picky 🙂

  • First of all thanks a lot for mentioning this class. Nice Blog.

    On a lighter note, i very happily went to my system, SE24, displayed the class. checked the class documentation and this is the GEM i found 🙂

  • Hi,

    Don’t have experience with the class version but I was always trying to stay away from the progress bar when my programs was making updates on the DB or at least being very careful. If I remember correctly it is triggering an implicit commit at each GUI update.

     

    Regards,

    David.