Uderc programming article aggregator sites

How to schedule a background Job based on events

Answers: Have 4 answers
We are on 4.6 C.
We have a background job that has two ABAP programs.
We need to start the 2nd ABAP program only after the first one has run successfully.
If the second ABAP program does not run, the the job should have a status "FINISHED".
Help appreciated.
The best answer: Hi,
How to schedule a background Job based on events,please refer to the follow SAP help:
You can use events that have already been defined, or you can create new events for scheduling background jobs.
If you wish to use new events, do the following to implement the event scheduling:
Define and transport the event as a user event with transaction SM62.
You must define only event IDs; event arguments are not defined in the R/3 System. Instead, you specify event arguments when you schedule a job to wait for an event and when you trigger the event.
If you define a new event, you must also transport it to your production systems. The event transaction does not have a connection to the transport system. Instead, you must create a transport request for the event yourself.
Do this to transport an event:
Create a transport request.
Start the editor in the transport request and enter the following:
R3TR TABU <table name> where table name is BTCSEV for a system event ID, BTCUEV for a user event ID.
Press F2 with the cursor on the table name to call up the screen for specifying the table entries to transport. In this screen, enter the event ID’s that you have created.
Save and release the transport request. Ensure that it is imported into your production system(s).
To trigger an event, add:
– the function module BP_EVENT_RAISE to your ABAP program, or
– the program SAPEVT to your external script, batch file, or program.
When your programs execute these keywords, an event will be triggered in the R/3 background processing system. The event-based scheduler is started immediately. It in turn starts all jobs that were waiting upon the event, subject to normal background processing restrictions, such as the requirement that the job has been released to start.
Schedule the jobs that are to run when your events are triggered.
You can schedule jobs for one-time start or to be started whenever an event is triggered.