Start of Content Area

Object documentation Events in Background Processing Explained  Locate the document in its SAP Library structure

Definition

In addition to time- and calendar-based job scheduling, the background processing system supports event-driven scheduling. The image below illustrates how background processing events can be used and processed.

This graphic is explained in the accompanying text

Use

Events have meaning only in the background processing system and can be used only to start background jobs.

Triggering an event notifies the background processing system that a particular condition has been met. The background processing system reacts by starting any jobs that were waiting for that event.

A log of all the events raised in the system is stored in the event history. For more information, see Working with Raised Events.

Integration

Event Types

There are two types of events:

      System events: Defined by SAP and triggered automatically by system changes, such as the activation of a new operation mode. You cannot modify system events.

      User events: Defined by users. These events must be triggered from ABAP or from external programs. For example, use an external program to trigger a background processing user event to signal the arrival of external data to be read into the SAP System.

Event Arguments

An event argument is an optional text string you can use to qualify an event. Event-based jobs can be scheduled to start not only after a specific event, but also after an event qualified by specific event parameter.

You can specify an event argument when:

      Scheduling a job to wait for the event

      Triggering an event

Unlike event IDs, event arguments are not defined in the SAP System.

If you specify an argument when you schedule a job, then the job is eligible to start only when the event is triggered with the argument.

If you don’t specify an argument when you schedule a job, then the job can start as soon as the event occurs. The job is eligible to start no matter what argument string is supplied with the event.

When a Job Waiting for an Event May Start

Job

Event

Result

Job scheduled with Event ID “JSTART” Argument “A”

JSTART triggered, no argument

Job does not start, continues to wait for JSTART A

 

JSTART triggered with argument “A”

Job starts

 

JSTART triggered with argument “B”

Job does not start; continues to wait for JSTART.

Job scheduled with Event ID “JSTART”, no argument

JSTART triggered, no argument

Job starts

 

JSTART triggered with any argument

Job starts

 

An ABAP program that is running as a background job can find out what event and argument were presented when it was started. This allows ABAP programs running in the background to react intelligently to an event depending on the argument string that was supplied with it.

Example

An Example of Events and Event Arguments

Switching to a different operation mode triggers a system event in the background processing system. The event is an SAP System event named SAP_OPMODE_SWITCH. As an argument, the event carries the name of the new operating mode.

If you schedule a job to wait on the event SAP_OPMODE_SWITCH with argument NIGHT, then your job is eligible to start when the operating mode NIGHT becomes active the next time.

You can also schedule jobs to be repeated each time event occurs. In the previous example, your job could be run each time the operating mode NIGHT becomes active, not just the first time the event occurs.

Note

The Operation mode button allows you to schedule a job to wait for a particular operation mode to become active.

See also:

Working with Events

 

 

End of Content Area