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, the 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 specify queue name rules:
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.
These examples are deliberately simple, and are a template for creating your own function modules.