[ABAP] Fortschrittsanzeige anzeigen

Variante 1 (cl_progress_indicator)

PARAMETERS: p_times1 TYPE i DEFAULT 15.

DO p_times1 TIMES.
  cl_progress_indicator=>progress_indicate( i_text               = |Fortschritt { sy-index } / { p_times1 }|
                                            i_processed          = sy-index     " Wert
                                            i_total              = p_times1     " Maximum
                                            i_output_immediately = abap_true ). " true -> sofort, false -> aller 10s darstellen

  WAIT UP TO 1 SECONDS.
ENDDO.

Variante 2 (cl_akb_progress_indicator)

CONSTANTS: co_max TYPE i VALUE 1000000.

START-OF-SELECTION.
  DATA(o_progress) = cl_akb_progress_indicator=>get_instance( ).

  DO co_max TIMES.
    o_progress->display( force_display = abap_false
                         total         = co_max
                         processed     = sy-index
                         message       = 'Bitte warten...' ).
  ENDDO.

Variante 3 (SAPGUI_PROGRESS_INDICATOR)

DATA: index TYPE i.
DO 20 TIMES.
  index = sy-index * 5.

  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      percentage = index
      text       = 'Bitte warten ...'.

  WAIT UP TO 1 SECONDS.
ENDDO.