If you want to ensure that IDocs sent are posted in the same sequence in the recipient system as they were sent, you can specify that a particular message type is sent, with qRFC (queued RFC), in the partner profile (transaction WE 20). When you send by qRFC, die IDocs are first put in an outbound queue in the sending system, and then in an inbound queue in the recipient system. You can assign IDocs to various queues and specify queue name rules.
You have a function module which creates queue names.
To define a queue name rule:
Choose WE85).
(transactionSwitch to change mode ( Display -> Change pushbutton).
Choose New Entries.
Specify a name and the associated function module for each rule.
Save your entries.
The function modules IDOC_QUEUE_CONST_EDIQUEUE and IDOC_QUEUE_NAME_MESTYP, which are delivered by SAP with the transaction WE85, are simplified examples of queue names:
IDOC_QUEUE_CONST_EDIQUEUE is a specified queue name constant.
IDOC_QUEUE_NAME_MESTYP creates the queue names from part of the logical message type name.
This examples have been kept simple deliberately and can be used as a template for creating your own function modules.