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

Continuously running a program in background

former_member853013
Participant
0 Likes
836

Hi all,

I have to develop a program. it should execute continuously in background.

One solution is to schedule a job for every minute.

Is this correct or any alternative (without scheduling job)?

Thanks in advance.

Regards,

Eswar

4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
664

What is this program supposed to do, besides running continuously?

Read only

0 Likes
664

Hi,

In my systems, data flows from SAP to other systems as Queues. A custom program will display this queue statuses (running, stopping, hold, etc).

Now my requirement is, a job will execute daily at 6 pm. but at the same time status should not be in 'HOLD'.

If the status is in 'HOLD', execution of my job should wait untill to change the status.

As per my idea to check this status i have developed another program. if the status is in 'running', then it will raise en event to trigger my job.

So please suggest me to run a program in background continuosly.

Regards,

Eswar

Read only

0 Likes
664

Hi

Why don't use a DO/ENDDO cycle where the condition for exit is for a certain value of the status: in this way the program run until it finds the right status and u don't need to run a job continuously.

DO.
  PERFORM DO_SOMETHING.
  
  IF STATUS <> 'HOLD'.
    EXIT.
  ENDIF.
ENDDO.

Anyway u make sure the correct value of status can be reached as u can risk the program works forever.

Max

Read only

former_member265047
Active Participant
0 Likes
664

Hi Eswar,

Right way is to schedule a job in SM36 for every minute. So that you can even monitor that job and find out whether program being executed sucessfully or not.

But why do you want to execute a program continuously and make sure that it wont make any impact on the performance of the production server. Because background jobs takes more priority than online programs.

Regards,

Naveen Veshala