REPORT ZIMRETTT.
**********************************************************
* This program is not very useful, but interesting.
* When started, it hides the screen, it is running in.
* After a preset time (60 second) it sends a popup window 
* asking the user, if he wants it to be awaken. In case the
* user does not answer in 3 seconds, it removes the popup 
* window and goes back to sleep.
* Create the following little program and associate it
* with transaction code ZITS:
*
*REPORT ZIMRETST.
*DATA: ANSWER, A(8).
*TABLES: INDX.
*CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
*     EXPORTING
*          DEFAULTOPTION  = 'N'
*          TEXTLINE1      = 'Do you want to awake the'
*          TEXTLINE2      = '   sleeping window?'
*          TITEL          = 'You have 3 seconds to answer'
*          CANCEL_DISPLAY = ' '
*     IMPORTING
*          ANSWER         = ANSWER.
*IF ANSWER = 'J'.
*  A = 'ZIZIZI'.
*  EXPORT A TO SHARED BUFFER INDX(ST) ID 'ZAZAZA'.
*ENDIF.
**********************************************************
*
TABLES: INDX.
DATA: A(8) VALUE 'ZAZAZA'.
DATA: MODE LIKE SY-INDEX.
* Put my mark into the shared buffer
EXPORT A TO SHARED BUFFER INDX(ST) ID 'ZAZAZA'.
* Hide myself
CALL FUNCTION 'SAPGUI_SET_PROPERTY'
     DESTINATION 'SAPGUI'
     EXPORTING PROPERTY   = 'VISIBLE'
               VALUE = ' '.
* Wait for being called back
DO.
* Sleep for 60 seconds
  CALL FUNCTION 'ENQUE_SLEEP'
       EXPORTING
            SECONDS = 60.
* Ask the user, if he wants me back
  CALL FUNCTION 'TH_CREATE_MODE'
       EXPORTING
            TRANSAKTION = 'ZITS'
       IMPORTING
            MODE        = MODE.
* Wait 3 seconds for the answer
  CALL FUNCTION 'ENQUE_SLEEP'
       EXPORTING
            SECONDS = 3.
* Check if I am wanted back. If not: go back to sleep
  IMPORT A FROM SHARED BUFFER INDX(ST) ID 'ZAZAZA'.
* Delete the popu window
  CALL FUNCTION 'TH_DELETE_MODE'
       EXPORTING
            MODE = MODE.
* Exit if asked so
  IF A = 'ZIZIZI'.EXIT.ENDIF.
ENDDO.
* No more sleep, redisplay myself
CALL FUNCTION 'SAPGUI_SET_PROPERTY'
     DESTINATION 'SAPGUI'
     EXPORTING PROPERTY   = 'VISIBLE'
               VALUE = 'X'.