Adapter for SAP 10.1 | webMethods Adapter for SAP Documentation | webMethods Adapter for SAP Installation and User’s Guide Documentation | Routing Messages Through Adapter for SAP | Content-Based Routing and Mapping for IDocs
 
Content-Based Routing and Mapping for IDocs
Occasionally, you must do some manipulation on IDocs before processing them in Adapter for SAP or before sending them to an SAP system. This will happen with customized IDocs that need specific processing. The two most common manipulations are content based routing and mapping. Both mechanisms can be performed on IDocs routed through Adapter for SAP. For IDocs going to an SAP system, only mapping manipulation applies.
*Content based routing enables you to specify routing parameters (sender, receiver and msgType) that override parameters in the header of the incoming IDocs. You determine such routing parameters from the content of the IDoc itself. For example, you want to provide routing parameters like 'vendor' or 'sales organization' in a PO as information for the receiving system (instead of just the logical system's name).
*Mapping is the mechanism that adds (or removes) data segments to (from) a document. Use this if you want to include the parameter 'sales organization' in the ORDERS IDoc.
A practical example for using the pre-routing mechanisms features is if you have a special Orders IDoc that contains its receiver and sender information in specific fields in the IDoc itself. It also contains extra fields that you want removed, or added, before you process the IDoc as an ORDER02 IDoc. You register special pre-routing services based on message types. You also can create a standard processing service to be executed for all message types and provides default routing information.
You can register both inbound and outbound manipulation services. The inbound services are executed for inbound IDocs received by Adapter for SAP via a RFC Listener or by invoking the pub.sap.transport.ALE:InboundProcess service (for example: over HTTP). The outbound services are executed before an IDoc is sent to an SAP system by pub.sap.transport.ALE:OutboundProcess.
*To register an inbound or outbound mapping service
1. For the inbound case, create one or more services that implement the pub.sap.transport.ALE:aleRoutingInfo and/or pub.sap.transport.ALE:aleRoutingInfo_Default specification. For the outbound case, the services need to implement either the pub.sap.transport.ALE:aleMappingInfo and/or pub.sap.transport.ALE:aleMappingInfo_Default specification.
2. After having implemented a service, you still have to make it known to the IDoc transport. Go to Adapters > Adapter for SAP > Routing/Mapping.
3. Follow the link Register New User Exit Service and then select one ALE Routing/Mapping Info * type.
4. Provide the full service name and the message type in the input field, and then click Register.
A routing/mapping service has to use the following specifications for proper behavior:
Specification
Description
pub.sap.transport.ALE: aleRoutingInfo
Specification that should be used for services which provide an inbound content based routing/mapping.
pub.sap.transport.ALE: aleRoutingInfo_Default
Specification that should be used for services which provide a default inbound routing/mapping
pub.sap.transport.ALE: aleMappingInfo
Specification that should be used for services which provide an outbound content based mapping.
pub.sap.transport.ALE: aleMappingInfo_Default
Specification that should be used for services which provide a default outbound mapping.
After you registered your routing services you can associate them with message types via the IS Administrator UI (Adapters \> Adapter for SAP \> Routing/Mapping).
Important:
In the SAP Routing/Mapping screen of the IS Administrator UI there are two sections to select services: a message type independent section (default handling section) and a message type dependent section.
A default handling service (inbound or outbound) is executed for all message types. If there are services selected in the message type dependentsection, they will be executed for the corresponding message type in addition to the default service. If the special value $noneis selected, all registered services are set to inactive.
Note:
The services for content based routing have to be registered by yourself before they can be selected via the IS Administrator UI.
Important:
If you create your own default inbound routing service, you must set the parameters sender, receiver and msgType. Those parameters are part of the specification. If you do not set them, you could receive an error message.
Note:
The setting of the default services works the same way as the setting of regular services. You need to register a service before you can select it. If no "* Default" Routing/Mapping type has been registered, then you will not have a choice for selecting one at all, which is the case with the adapter out of the box. $none choice is only there if one or more services are registered.
For all incoming IDocs with an ORDERS message type, the sample.sap.idoc.Mappings:orders service will be executed. The service may alter the IDoc as well as the routing parameters for the IDoc. For IDocs going to the SAP system with ORDRSP message type, the sample.sap.idoc.Mappings:ordrsp service will be executed. This service can alter the IDoc by adding or removing fields.