You can use a pattern to process IDocs of various kinds with a single RFC program ID without having to redeploy or rediscover existing adapters, even when adding new types of IDoc.
Read the concept topic about Generic IDoc routing.
You can create a routing message flow that contains an SAPInput node. You can use this flow to route the IDocs, based on their type, to separate message flows that deal with each different IDoc type. If the set of discovered IDocs is extended, you can create a message flow and message definitions, then deploy them, without the need to change existing message flows or message definitions.
For more information about the pattern that is used in this task, see Data distribution SAP to WebSphere® MQ: one-way (for IDoc). You can view patterns in the product documentation by using the links only when you use the product documentation that is integrated with the IBM Integration Toolkit, or when you use the online product documentation.
The following instructions describe how to use a pattern to create the resources that you need.
Result: The SAP adapter is connected by using the program ID that is specified in the configurable service. The message flow receives an IDoc from SAP and writes it to WebSphere MQ. The ESQL code in the Compute node specifies that the queue name to which the message is written is the same as the IDoc type. You can create separate message flows to process the different types of IDoc.