WESB listening on multiple IDoc basic types from SAP

IBM redbook named “Connect WebSphereService-Oriented Middleware to SAP” covers steps necessary for receiving IDocs from SAP using WebSphere adapter. But what if your ESB solution requires receiving and processing several IDocs basic types, such as Orders02 and Invoice01? Do you simply create another adapter module? That’s correct, but you will also need to make the following changes.

1) Each mediation modules should listen on a single IDoc basic type. Configure each module to use separate RFC Program ID. If you neglect this, SAP will have no way of determining which module to send each IDoc to and IDocs will be routed to random modules. This is certainly not the behavior you desired

2) Configure destinations in SAP for these RFC Program IDs. Please note that additional configuration is required on SAP side. Use the redbook as your guide

3) Each of the mediation modules you created in step 1 will use SAP adapter in inbound mode. Adapter should be deployed with the module.

Practitioner’s note: I had trouble getting this configuration to work correctly when SAP adapter is also installed at node level (“deployed on the server”) in WESB 6.1.2. SystemOut log entries showed that each IDoc was processed by correct adapter instance (deployed with module), but adapter behaved as if it were server-wide instance. It was unable to find method binding to process inbound IDocs in many cases. It is probably a bug, but you don’t have to wait for a fix. Simple workaround is not to mix up server- and module-packaged SAP adapter instances. In other words, when you need to listen on multiple IDoc basic types from SAP, DO NOT deploy adapter on the server level.