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 four event detection mechanisms that the connector 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 and change pointer do 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, Batch Program, and Change Pointer 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. Change Pointer and Batch Program are 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 and change pointer are affected by application changes the most because they are 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, while change pointer is the most difficult because it requires a more intimate knowledge of SAP and the business process being evaluated.

Future events
Do you need to be able to capture an event real-time and then delay its retrieval until a specified date? For example, an employee record may be updated today with a change of address that is effective three weeks from today. In this case, you may want to capture the event at the time of the update, but delay its retrieval until the effective date.

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

Table 49. Event detection mechanism decision table


Code enhancement Batch program Business workflow Change pointer
Availability High High Low Low
Real-time integration Yes No Yes Yes
Reliability High High Low Medium
Flexibility High Medium Low Medium
Upgrade dependency Low Low Medium Medium
Difficulty Medium Low Medium High
Future Events Yes Yes No No

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, business workflow and change pointer mechanisms are 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.

All of the event detection mechanisms support real-time triggering and retrieval of events. However, only code enhancement and batch program provides the additional functionality of delayed retrieval. An event specified to be retrieved at a later date is called a future event.

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

Change pointer

Change pointer is a related feature of business workflow that uses change documents to detect events. Change documents are created for some business processes so that all changes for that business process are captured.

Advantages

Disadvantages

Copyright IBM Corp. 1997, 2004