Tips and Tricks for the ABAP® Programming Language

ABAP® Program Y9030016 – Display actual information within the SAPGUI® statusline

Sometimes it can be useful to display a few additional information within the Sapgui® statusline. The first part of the status line consists of a ‘percent bar’, in the second part one text line can be displayed. The example report shows a part of the T100. Always 70 lines are packed together in one internal table (IT100). This table will then be processed and the percent plus status line is updated with each table line Please excuse the simple time loop, we focused only on the idea to show dynamic information to the user.

Parameters:
P_ANZ = “Blind loop count”, which determines indirectly the speed of the display. (Ok, a time loop should not normally build in that way)

ABAP-Source-Code

You can cut and paste the source code directly into the ABAP-Workbench.

REPORT Y9030016 LINE-SIZE 130.      "Release 4.5A (previous releases ?)
************************************************************************
* Copyright (c) 1999 by CT-Team, 33415 Verl
* only use for CT-DEBUG_Simulator
* you can use or modify this report for your own work as long
* as you don't try to sell or republish it.
* in no event will the author be liable for indirect, special,
* Incidental, or consequental damages (if any) arising out of
* the use of this report.
*
************************************************************************
*//////////////////////////////////////////////////////////////////////*
 MOVE: 'Testmember: Display of infos during processing to SAPGUI'
        TO SY-TITLE.
*//////////////////////////////////////////////////////////////////////*
***************         Parameter                 **********************
 PARAMETERS:  P_TIME(2) TYPE N DEFAULT '01'.   "number of seconds delay
*
***************         Externe Tabellen          **********************
TABLES: YT100.                          "only use for CT-DEBUG_Simulator
***************         Interne Tabellen          **********************
 DATA: BEGIN OF IYT100 OCCURS 0.
        INCLUDE STRUCTURE YT100.
 DATA: END OF IYT100.
***************         Variablendeklaration      **********************
 DATA: ROCKS TYPE I.
*//////////////////////////////////////////////////////////////////////*
*************            Programmsteuerung           *******************
*//////////////////////////////////////////////////////////////////////*
*
 PERFORM READ-AND-DISPLAY-T100.
*
*//////////////////////////////////////////////////////////////////////*
*************              Unterprogramme            *******************
*//////////////////////////////////////////////////////////////////////*
************************************************************************
*       Read a part of table T100 and display it upon SAPGUI
************************************************************************
 FORM READ-AND-DISPLAY-T100.
*
 WRITE: /1 'Information for the USER ....' COLOR 6.
 ULINE.
 WRITE: /5 'Step 1: the content of iyt100 display at SAPGUI' COLOR 5.
 ULINE. SKIP.
*.......................................................................
*
  SELECT * FROM YT100
         WHERE ZSPRSL EQ 'E' AND
         ZARBGB BETWEEN 'Z07' AND 'Z09'.
         APPEND YT100 TO IYT100.
  ENDSELECT.
*......................................................................1
  LOOP AT IYT100.
     ROCKS = 100 * SY-TABIX / 70.
     IF ROCKS = 0.
        ADD 1 TO ROCKS.
     ENDIF.
*#######################################################################
     CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
             PERCENTAGE = ROCKS
             TEXT       = IYT100-ZTEXT1.
*......................................................................2
     WAIT UP TO P_TIME SECONDS.            "time of delay
*.......................................................................
     WRITE: /1 'YT100-Text:', IYT100-ZTEXT1.
  ENDLOOP.
*
 ENDFORM.
************************************************************************
************************************************************************
******************* Programmende ***************************************
pixelstats trackingpixel