For inbound messages coming to our SAP system ,we can make SAP/XI to put messages in serialized queues by configuring QOS parameter of communication channel objects on SAP/XI system. Thanks to this ability, messages coming to SAP from external systems are processed in order after reaching SAP. Arriving messages are processed in SMQ2 queues with the name that had been determined in SAP/XI.
It is clear that configuration of inbound messages according to EOIO is managed by XI system however for outbound messages send by our SAP system, we need to configure EOIO logic in ABAP proxy. This could be done by an ABAP code snippet. In this code we just give a queue name to messages so that all messages send by this client proxy use that specified queue both in SAP and SAP/XI system. As you know these messages are processed by SMQ1 with the predetermined queue name.
Here is the code snippet to send outbound messages in EOIO way with a custom outbound queue name.
data lo_proxy type ref to zcl_outbound_proxy.
data lo_async_proxy type ref to if_wsprotocol_async_messaging.
lo_async_proxy ?= lo_proxy->get_protocol( if_wsprotocol=>async_messaging ).
lo_async_proxy->set_serialization_context( '_CUSTOM_OUTBOUND' ).
call method lo_proxy->call_outbound_method
output = ls_output.
catch cx_ai_system_fault. .