‎2007 Jul 06 5:41 AM
selection screen should be executed automatically after 20 seconds with respect to the selection criteria? anybody send me the code for above criteria. You should not press F8 or execute it manually.
‎2007 Jul 06 5:51 AM
Hi,
Check this code...
<b>REPORT zeureka. .
CLASS lcl_handler DEFINITION.
PUBLIC SECTION.
METHODS: when_done FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_handler IMPLEMENTATION.
METHOD when_done.
cl_gui_cfw=>set_new_ok_code( new_code = 'ONLI' ). "ONLI = Execute
ENDMETHOD. "explode
ENDCLASS. "lcl_event_handler IMPLEMENTATION
TABLES: spfli, sscrfields.
PARAMETERS: pa_carr TYPE s_carrid DEFAULT 'AA'.
DATA: timer TYPE REF TO cl_gui_timer.
DATA: href TYPE REF TO lcl_handler.
AT SELECTION-SCREEN OUTPUT.
*Create the timer as well as the handler
CREATE OBJECT: timer, href.
*Register event handler
SET HANDLER href->when_done FOR timer.
*Set value according to your requirement
timer->interval = 10.
*Start timer
timer->run( ).
START-OF-SELECTION.
*Stop Timer once list processing begins
timer->cancel( ).
SELECT * FROM spfli WHERE carrid = pa_carr.
WRITE:/ spfli-connid, spfli-cityfrom.
ENDSELECT.</b>
U can change the time interval there in the code...
I got this from : /people/dushyant.shetty/blog/2007/06/06/abap-programming-technique-if-you-dont-run-this-report-in-10-seconds-itll-run-itself
Check out that blog..
Cheers,
SImha.
My points please....
‎2007 Jul 06 5:51 AM
Hi,
Check this code...
<b>REPORT zeureka. .
CLASS lcl_handler DEFINITION.
PUBLIC SECTION.
METHODS: when_done FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_handler IMPLEMENTATION.
METHOD when_done.
cl_gui_cfw=>set_new_ok_code( new_code = 'ONLI' ). "ONLI = Execute
ENDMETHOD. "explode
ENDCLASS. "lcl_event_handler IMPLEMENTATION
TABLES: spfli, sscrfields.
PARAMETERS: pa_carr TYPE s_carrid DEFAULT 'AA'.
DATA: timer TYPE REF TO cl_gui_timer.
DATA: href TYPE REF TO lcl_handler.
AT SELECTION-SCREEN OUTPUT.
*Create the timer as well as the handler
CREATE OBJECT: timer, href.
*Register event handler
SET HANDLER href->when_done FOR timer.
*Set value according to your requirement
timer->interval = 10.
*Start timer
timer->run( ).
START-OF-SELECTION.
*Stop Timer once list processing begins
timer->cancel( ).
SELECT * FROM spfli WHERE carrid = pa_carr.
WRITE:/ spfli-connid, spfli-cityfrom.
ENDSELECT.</b>
U can change the time interval there in the code...
I got this from : /people/dushyant.shetty/blog/2007/06/06/abap-programming-technique-if-you-dont-run-this-report-in-10-seconds-itll-run-itself
Check out that blog..
Cheers,
SImha.
My points please....
‎2007 Jul 06 5:53 AM
hi
u can shedule ur report to run in background in transaction in SM37.
regards
ravish
<b>plz dont forget to reward points if helpful</b>