Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

selection screen

Former Member
0 Likes
400

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.

1 ACCEPTED SOLUTION
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
348

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....

2 REPLIES 2
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
349

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....

Read only

Former Member
0 Likes
348

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>