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

Autorefresh dynpro



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Fri Aug 28, 2009 2:48 pm    Post subject: Autorefresh dynpro Reply with quote

Author: Ralf Rubel

the magic OO solution could look like this:

* 1) you need an event handler and some global variables
Code:
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: on_finished FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "lcl_event_handler DEFINITION

DATA ti_container TYPE REF TO cl_gui_custom_container.
DATA timer TYPE REF TO cl_gui_timer.
DATA event_handler TYPE REF TO lcl_event_handler.
DATA timeout TYPE i VALUE '20'.

* 2) Place a container (as small as possible) on your dynpro


* 3) In PBO of your dynpro, you have to instance the timer control
Code:
IF ti_container IS INITIAL.
CREATE OBJECT ti_container
EXPORTING container_name = 'TI_CONTAINER'.
CREATE OBJECT timer EXPORTING parent = ti_container.

SET HANDLER event_handler->on_finished FOR timer.


* 4) and start your timer
Code:
timer->interval = timeout.
CALL METHOD timer->run.
ENDIF.


* 5) At least you have to react on the event on_finished
Code:
CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_finished.
* Start Timer again
timer->interval = timeout.
CALL METHOD timer->run.
* cause PAI
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'REFR'.
ENDMETHOD. "on_finished
ENDCLASS. "lcl_event_handler IMPLEMENTATION

Best regards
Ralf

Source: https: /forums.sdn.sap.com/thread.jspa?threadID=16030&tstart=0
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 -> Programming Techniques | Приемы программирования 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.