Designing an event detection mechanism

You can use many different mechanisms to detect events in the SAP application. An event detection mechanism should have the ability to make a function module call. The three event detection mechanisms that the IBM WebSphere Business Integration Adapter for mySAP.com (SAP R/3 Version 3.x) has implemented are:

It is important that you determine the appropriate event detection mechanism to implement for each business object that you develop, because some may not be available for a particular business process. Technical and functional knowledge of a particular business process is necessary for each transaction for which you want to implement event detection.

Review the following implementation considerations when determining which event detection mechanism to implement for your business process.

Availability
Which event detection mechanisms are available for this business process? This should be one of the first questions that you consider. Code Enhancement and Batch Program have high availability, whereas Business Workflow does not.
Real-time integration
Do events need to be detected synchronously? Do you need to detect a large number of events at one time? All mechanisms except Batch Program are suitable for real-time integration.
Reliability
Are all data changes for this business process detected when generating an event? Code Enhancement and Batch Program, provide the best control of capturing all events of an object. Business Workflow provides limited reliability. For example, Business Workflow does not detect an address change during a Vendor transaction update.
Flexibility
Do certain criteria need to be evaluated before an event is triggered? Does an event need to be detected at a certain point in the transaction? Code Enhancement is the most flexible, because you can insert code at a specific point before event data is committed. Batch Program is moderately flexible, while Business Workflow has very little flexibility in its implementation.
Upgrade dependency
Does an upgrade to the SAP application change the way an event is detected for this business process? Typically, this is not known, but Business Workflow is affected by application changes the most because it is under SAP's control.
Difficulty
Is time or level of difficulty an issue? Each mechanism has its own level of implementation difficulty. In general, Batch Program is the easiest. Code Enhancement and Business Workflow are moderately more difficult.

At this point, you should have an idea of the event detection mechanisms that you need to consider. Use Table 14 as a general guideline in determining which mechanism can be used for each business process you need to support.

Table 14. Event Detection Mechanism Decision Table


Code Enhancement Batch Program Business Workflow
Availability High High Low
Real-time integration Yes No Yes
Reliability High High Low
Flexibility High Medium Low
Upgrade dependency Low Low Medium
Difficulty Medium Low Medium

A final consideration to note is the development methodology of your site. Perhaps event detection using only Business Workflow is the preferred method and Code Enhancement cannot be used at all.

Using Code Enhancement is the recommended approach for event detection because it is reliable, highly flexible, synchronous, and has high availability. In contrast, the Business Workflow mechanism is not generally available for all business processes. Batch Program is typically used when real-time integration is not desired.

Each event detection mechanism has advantages and disadvantages for detecting an event in a business process. The following sections give more detail about each of the event detection mechanisms, including the main advantages and disadvantages of each.

Code enhancement

Code Enhancement is implemented at specific points in the code of an SAP transaction. By making use of user exits, you can insert event detection code at the most logical point in a transaction. The event detection code allows for evaluation of criteria to determine whether an event is generated.

The general strategy of this mechanism is to insert your event detection code when the data for a transaction is about to be committed to the database.

Advantages

Disadvantages

Batch program

Batch program is useful when a large number of events of the same type (such as customer orders) need to be triggered or a business process requires a large amount of processing time. This mechanism does not require any modifications to SAP delivered code; however, you need to use (write) an ABAP program that evaluates criteria for detecting events.

Advantages

Disadvantages

Business workflow

Business workflow is a cross-application tool within the SAP application that enables you to integrate business tasks between applications. This tool supplements the existing business functions of the SAP application. The standard functions of SAP can be adapted using Business Workflow to meet the specific requirements of the desired business function. Business Workflow uses the Business Object Repository (BOR), which stores the definitions for each SAP object in the application.

Advantages

Disadvantages

Copyright IBM Corp. 1997, 2004