Skip to Content
Technical Articles
Author's profile photo Enno Wulff

Bring SAPGUI mode to the front

Although the SAPGUI is called to be dead, there are sometimes new things to learn. this week I learned how to bring a SAPGUI mode to the front. The code has been found in the transport organizer where it is needed to bring the popup for request selection when editing a dynpro in the screen painter.

The following demonstration report can be started in two overlapping SAPGUI modes with about one second time shift.

REPORT zz_activate_gui_mode.

DO 10 TIMES.
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      text = |Mode: { sy-modno }  Index: { sy-index }|.

  CALL FUNCTION 'SAPGUI_SET_PROPERTY'
    DESTINATION 'SAPGUI'
    EXPORTING
      property = 'ACTIVATE'
      value    = 'X'
    EXCEPTIONS
      OTHERS   = 0.

  WAIT UP TO 3 SECONDS.
ENDDO.

You will see that rotationally the next mode will come to front.

Maybe you will find a use for this functionality…

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Tom Wan
      Tom Wan

      just tried. interesting 🙂

      Author's profile photo Peter Inotai
      Peter Inotai

      Thanks for sharing.

      It reminds me to the invisible trick, which I've seen about 15 years ago and it's really cool 🙂

      REPORT  ztest_invisible_trick.
      
      *************************************************************
      START-OF-SELECTION.
      *SAPGUI screen vanishes from user screen list
      
        CALL FUNCTION 'SAPGUI_SET_PROPERTY'
          DESTINATION 'SAPGUI'
          EXPORTING
            property              = 'VISIBLE'
            value                 = ' '
          EXCEPTIONS
            system_failure        = 1
            communication_failure = 2
            OTHERS                = 3.
      
      ************************************************************************
      
      
        DO 10000 TIMES.
      
      *doing some work which takes lot of time
          DO 1000 TIMES.
          ENDDO.
      *Resetting time counter of dialog process so that time-out does not
      *happen. Use this fm within your programs at appropriate locations to
      *reset time counter.
      
          CALL FUNCTION 'TH_REDISPATCH'.
      
        ENDDO.
      
      *************************************************************
      *Work is complete and now wake up the SAPGUI screen
      
        CALL FUNCTION 'SAPGUI_SET_PROPERTY'
          DESTINATION 'SAPGUI'
          EXPORTING
            property              = 'VISIBLE'
            value                 = 'X'
          EXCEPTIONS
            system_failure        = 1
            communication_failure = 2
            OTHERS                = 3.
      Author's profile photo Shashank Mistry
      Shashank Mistry

      Interesting indeed ! Thanks for sharing