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

Timer | Временные задержки



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Sun Feb 10, 2008 2:57 am    Post subject: Timer | Временные задержки Reply with quote

ENQUE_SLEEP

Code:

CALL FUNCTION 'ENQUE_SLEEP'
EXPORTING
seconds = 300
EXCEPTIONS
system_failure = 1.

IF sy-subrc IS INITIAL.
  WRITE 'I wake up !'.
ENDIF.

" Or just try this way
WAIT UP TO 300 SECONDS.
WRITE 'I wake up !'.


RZL_SLEEP - sleep between 1 to 5 seconds
Code:
    CALL FUNCTION 'RZL_SLEEP'
         EXPORTING
              SECONDS        = 1
         EXCEPTIONS
              ARGUMENT_ERROR = 1
              OTHERS         = 2.


CLASS gui_timer
Example Author: Rich Heilman
This uses the gui timer, so it will not hold up your dialog process, it will count till the timer runs out and give a message.

Code:

REPORT zrich_0001.
DATA: gui_timer TYPE REF TO cl_gui_timer.
DATA: timeout TYPE i VALUE '3'.

CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: on_finished FOR EVENT finished OF cl_gui_timer.

ENDCLASS.

CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_finished.
MESSAGE i001(00) WITH 'Hey, its been 3 seconds, im done'.
ENDMETHOD.
ENDCLASS.

PARAMETERS : p_check TYPE c.

AT SELECTION-SCREEN OUTPUT.

CREATE OBJECT gui_timer.
SET HANDLER lcl_event_handler=>on_finished FOR gui_timer.
gui_timer->interval = timeout.
CALL METHOD gui_timer->run.



To increase the time, simply change the value of the TIMEOUT variable to the desire number of seconds.

Regards,
Rich Heilman
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 -> Function Modules | Функциональные модули 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.