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: 

batch job scheduling based on Event AND for the job to complete

shirley_te
Participant
0 Kudos

I am trying to schedule a background job based on an event AND based on the job finishing itself.

Example:

Job name: Send_Message

After Event: SAP_NEW_PROCESS Message

Program: Program xxxx

I want that the Send_Message job only runs when the Event SAP_NEW_PROCESS message happens AND the Send_Message job is not running.

Right now, I could only schedule it based on the event SAP_NEW_PROCESS Message which means that everytime this event happens the job runs and I end up having the job "Send_Message" in multilple intances where the others will immediately cancel since the first job is still running and so I end up with a lot of Cancelled job when it is not necessary to run them all when there is already 1 instance of the Job running.

How do I set it up in SAP?

2 REPLIES 2

andreas_mann3
Active Contributor
0 Kudos

do sth like this:

create a pre-job JOB_0 , which analyse whether your job, JOB_1, is running

If not -> trigger event E1 and JOB_1

A.

0 Kudos

Thanks but I am new to SAP having to set up a batch job.

The Event "SAP_NEW_PROCESS_MESSAGES" is a standard SAP Event. We used that such that when a new transaction comes in, the batch job will run but we don't want to run the batch job if the same batch job is already running.

YOu mentioned that I should set up Job_0. Do I need to create an ABAP prorgram to check if JOB_1 is running? How do I set up Job_0? What is the trigger for my Job_0 to run?

You also said that I set up Job_1 and trigger that based on the outcome of Job_0 AND at the same time be triggered by the event "SAP_NEW_PROCESS_MESSAGES". How do I set up this Job_1 so that it can be triggered by both Job_0 and a new transaction coming in(SAP_NEW_PROCESS_MESSAGES).

if you can provide me the step by step guide as I am new to this and I only know basic.

The current set up I have is

Job_1

Job Start:

After Event

Event: SAP_NEW_PROCESS_MESSAGES

Step 1: program to run RCOCB002

I was thinking following your suggestion is this:

Job_0

Job Start

After Event

Event: SAP_NEW_PROCESS_MESSAGES

Step 1: program to run - What will be my program to run?

Job_1

Job_Start

After Event

Event: What will be my trigger for Job_1 and how do I set it up?

Step 1: program to run RCOCB002

Edited by: Shirley Te on Mar 10, 2010 3:25 PM