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:
- Code Enhancement--implemented for a business process
(normally a single SAP transaction) by inserting event detection
code at an appropriate point within the SAP transaction
- Batch Program--involves developing an ABAP program containing
the criteria for detecting an event
- Business Workflow--uses SAP's own object-oriented event
detection capabilities
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 46 as a general guideline in determining which mechanism
can be used for each business process you need to support.
Table 46. 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
- Has access to SAP transactional information for the event detection
process
- Allows the insertion of event detection code at an appropriate
point of a transaction
- Provides synchronous event detection
- Limits the reliance on SAP functionality, so maintenance and
enhancements are easier
Disadvantages
- User exits may not always be in the appropriate location in
the transaction.
- SAP modification features may be necessary.
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
- Can be implemented for most business processes
- Accurately detects events
- Is easy to implement
- Can be scheduled to run at a specific time if runtime resources
are an issue
Disadvantages
- It does not provide synchronous event detection.
- SAP transactional information is not available.
- State (create, update, or delete) or status changes cannot be
detected or may not be easily detected.
- If a background job is created to automate a batch program,
an additional task needs to be maintained and monitored.
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
- Provides synchronous event detection
- Makes use of SAP's object-oriented business object
capability to link the detection of events to ABAP function modules
- Is easy to implement
Disadvantages
- An SAP object does not exist in the SAP BOR for every business
process.
- The SAP event (such as created or deleted) may not exist for
the SAP object.
- It may not detect all changes in a business process.
- It does not always provide the flexibility for detecting events
at the proper time.
- It depends on SAP-provided functionality, which may change between
versions of SAP.
