Application Development 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: 

How to run the custom Tcode for every minute in foreground without user interaction SAP ABAP?

former_member396057
Participant

Hi,

I have developed module pool screen with Tcode. I will enter the Tcode only once in a SAP screen and it should run automatically for every minute without user interaction in the foreground.

How to run the Tcode for every minute in foreground automatically ?

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

Perform some search on class CL_GUI_TIMER. (e.g. handling its finished event to trigger a function code with cl_gui_cfw=>set_new_ok_code)

8 REPLIES 8

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Shabbir Ahmed,

"I have developed module pool screen with Tcode

What is the screen contains, For complex operation, if it is module pool program, you can create BDC.

"it should run automatically for every minute without user interaction in the foreground

If there is no interaction required, then the program should run in the background only.

1. Create the job in SM37 transaction for the particular(Main) program which runs every one minute and schedule the job 'After Event' and creates the event in SM62 transaction and create some flag variable inside the program which should work based on event raised from the Front-end.

2. Create one more program, update the above flag variable and create one transaction(new) and trigger the above-created event using FM BP_EVENT_RAISE.

3. Execute the new transaction in front end and the job will start run in the backend

Regards

Rajkumar Narasimman

0 Kudos

Hi Raj,

Thanks for reply.The foreground screen which has 'Total Attended' value which will change/increment for every minute.

This screen I want to show on foreground.

"if it is module pool program, you can create BDC."

Don't. BDC has been outdated for over 15 years.

And is UTTERLY unnecessary for a custom program.

raymond_giuseppi
Active Contributor

Perform some search on class CL_GUI_TIMER. (e.g. handling its finished event to trigger a function code with cl_gui_cfw=>set_new_ok_code)

kiran_k8
Active Contributor
0 Kudos

Shabbir,

But how do you intend to show your screen ? As a separate session ?

How about embedding this object in SAP Easy Access screen.

If they want that info,all they have to login to SAP and details will be available in SAP Easy Access Screen.

K.Kiran.

pokrakam
Active Contributor
0 Kudos

Technically it's easy to do with:

WHILE my_condition( ) = abap_true.
do_stuff( ). "Or: CALL TRANSACTION ZYX. WAIT UP TO 60 SECONDS. ENDWHILE.

But with Raymond's approach you have a bit more control.

Jelena
Active Contributor
0 Kudos

Why do you need this?