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.


WID tips: Use Unicode in SAP Connection

Here’s another error scenario in integration development using WID.
Problem: You set up your WebSphere ESB, Process Server or WID Test Environment to communicate with SAP using WebSphere adapter for SAP software. You prepare connection on SAP side, enter all connectivity parameters, but when you actually attempt to send or receive data, connection fails. You receive an interesting error message referring to a server function, but function name appears to be garbage:
JCO.Server could not find server function '剆䍟偉乇'
Solution: You forgot to configure SAP connection to use Unicode. This is how your connection is configured (WRONG):



Just change connection type to Unicode (RIGHT):



JCO library underpinning the adapter requires use of Unicode connection.

If you want to learn more about using SAP adapter, this developerWorks article is very hepful.