SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Some silly ABAP: show and hide windows by request



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Sun Nov 18, 2007 8:14 pm    Post subject: Some silly ABAP: show and hide windows by request Reply with quote

Code:
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'.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.