Evaluation and Maintenance of Type Linkages 
The type linkage describes the assignment of a receiver function module and a receiver type to a particular combination of object type and event.
A type linkage must be created if the system is always to react to an event of a particular object type. The type linkages are evaluated at runtime by the event manager.
The event receiver should define a type linkage using a function module provided.
Note
If events are used in SAP Business Workflow (as triggering and terminating events, for wait steps), the entries required are made by the workflow system.
If you enter an event as a triggering event of a workflow, for example, the following entries are made automatically:
Object type and event ID
Workflow to be started as receiver type
Function module SWW_WI_CREATE_VIA_EVENT as receiver function module
Type linkages are client-dependent and are written automatically into a Customizing transport request if the client is configured (in table T000) for changes to be recorded automatically. All entries are then transported including activation indicators.
In the case of client copy, you should ensure that the type linkages are copied into the target client, but are always deactivated in the target client.
The activation indicator of each individual type linkage is only copied with client copy if explicitly requested (parameter option for copying tables of class A).
The event manager begins the evaluation of the active type linkages when it is notified of the ID of a created event. For event handling to take place, either the event created and its triggering object type or the event created and a supertype of the triggering object type must be entered for the type linkage.

If the event manager finds a type linkage for the event created, the following processing steps take place:
If a receiver type function module is entered, it is called to determine the receiver type.
If a check function module is entered it is called. If its execution terminates with an exception, the linkage is not executed.
The receiver function module is called with the parameters event, receiver type, and event container.
If an error occurs within the function module SWW_WI_CREATE_VIA_EVENT (task missing or has errors, problems with tRFC), a mail is sent to the workflow system administrator.
The following fields are available in the type linkage table:
Object type and event ID
Note
Object type and event must be defined in the Business Object Repository.
Check function module (optional)
Receiver type function module (optional)
Flag: Type linkage activated
If this indicator is set, the type linkage is evaluated by the event manager.
Flag: Enable event queue
This indicator is only evaluated if the event queue is active.
If the indicator is set, the event receiver is started via the event queue. If the indicator is not set or the event queue is not active, the receiver is started immediately.
Behavior if error feedback
The system presetting maintained on the tab page Basic data in event queue administration can be adopted or revised.
Receiver status
The status of the event receiver affects the starting of the receiver. In general, the receiver linkage must be active to start the receiver. The status of the receiver linkage has the following effects:
No errors
If the receiver linkage has the status no errors, the receivers are started by the system. They can be started directly or via the event queue.
Errors
If the receiver linkage has the status errors, the receiver is not started immediately, but is put into the event queue automatically instead. There the entry is assigned the status "waiting because of error". So, the receiver is not started, but there is the option of restarting the receiver after the error has been removed. Triggered events are therefore not lost even if the linkages have errors. The event receivers can be started again using the tab page Linkages with errors.
You have to define and process the type linkages manually if:
You use event control within your own separate developments.
You want to analyze the entries made by the workflow system.
You want to add a check function module at a later date.
You want to activate a type linkage that is not controlled by the workflow.
You want the events of a particular type linkage to use the event queue.
The maintenance of the type linkages within SAP Business Workflow is otherwise catered for by the workflow system.
You can create a type linkage using the following function module:
Syntax
SWE_EVENT_REC_TYPE_ENTER
APIs are also available for processing individual fields of a type linkage.
Name of function module |
Explanation |
|---|---|
SWE_EVENT_REC_TYPE_CHECK_FB |
Changing the check function module for the event receiver |
SWE_EVENT_REC_TYPE_DISABLE |
Deactivating a type linkage |
SWE_EVENT_REC_TYPE_ENABLE |
Activating a type linkage |
SWE_EVENT_REC_TYPE_FB |
Changing the receiver function module |
SWE_EVENT_REC_TYPE_GET_FB |
Changing the receiver type function module |
SWE_EVENT_REC_TYPE_GLOBAL |
Setting a global event linkage |
SWE_EVENT_REC_TYPE_NOT_GLOBAL |
Deleting a global event linkage |
SWE_EVENT_REC_TYPE_READ |
Reading a type linkage |
Use the following function module to delete a type linkage:
Syntax
SWE_EVENT_REC_TYPE_DELETE
Note
If you create type linkages, ensure that you delete them again when they are no longer expected.
To maintain the type linkages, choose .
The overview displays the existing type linkages with details of object type, event, and receiver type.
Choose to add new type linkages.
Choose to change type linkages.