Fortschrittsbalken

Hier demonstrieren wir Ihnen einen Fortschrittsbalken, der ausnahmsweise nicht mittels SAPGUI_PROGRESS_INDICATOR dargestellt wird, sondern mit einem Tool aus dem SAP-Grafik-Bereich.

Coding

REPORT zz_fortschrittsanzeige.
******************************************************
* Fortschrittsanzeige                                *
******************************************************

DATA: BEGIN OF status,
        btn_txt(75),
        curval(6) TYPE n,
        maxval(6) TYPE n,
        stat,
        text_1(75),
        text_2(6),
        text_3(75),
        title(75),
        winid(4),
        m_typ,
        popup_event(10),
        rwnid(4).
DATA: END OF status.
DATA: popup_event_cancel(6) VALUE ‚CANCEL‘.
DATA: stat_4 VALUE ‚3‘.
DATA: lv_wert(15) TYPE c.


PARAMETERS: p_max   TYPE i DEFAULT 1000
          , p_step  TYPE i DEFAULT 1
          .

 

CLEAR status.

status-curval  = ‚1‘.
status-maxval  = p_max.
status-text_1 = ‚Hier kann ein (variabler) Text stehen‘.
status-text_2 = ‚ ‚.
status-title  = ‚Fortschrittsanzeige ( by johu )‘.

WHILE status-curval < p_max.

  ADD p_step  TO status-curval.

  WRITE: sy-index TO lv_wert.
  CONCATENATE lv_wert ‚ und hier auch…‘

        INTO status-text_3.
  CONDENSE status-text_3.

  CALL FUNCTION ‚PROGRESS_POPUP‘
    EXPORTING
      btn_txt     = status-btn_txt
      curval      = status-curval
      maxval      = status-maxval
      stat        = status-stat
      text_1      = status-text_1
      text_2      = status-text_2
      text_3      = status-text_3
      title       = status-title
      winid       = status-winid
    IMPORTING
      m_typ       = status-m_typ
      popup_event = status-popup_event
      rwnid       = status-rwnid.

  IF status-popup_event =   popup_event_cancel.

    PERFORM status_end USING status.
    EXIT.
  ENDIF.

  status-stat =         stat_4.

ENDWHILE.

PERFORM status_end USING status.

*———————————————————————*
*       FORM STATUS_END                                               *
*———————————————————————*
FORM status_end USING s STRUCTURE status.

  CALL FUNCTION ‚GRAPH_DIALOG‘
    EXPORTING
      close = ‚X‘
      kwdid = s-winid.

ENDFORM.                    „status_end

 

Enno Wulff
follow me
Letzte Artikel von Enno Wulff (Alle anzeigen)