Hi Praveen,
Hope this will help you,
From ECC, IDOC/RFC/Web Service can come to MII and gets stored into the Message Listener Buffer, so, From Message Listener we have to fetch the Message XML.
In MII, create a Transaction to fetch the IDOC which is stored in SAP MII Message listener came from SAP ECC.
In that Transaction, you can go with the below approach,
QueryMessage : In QueryMessage Action Block you have to do the following configuration to fetch the required Message came from ECC into Message Listener. It can be IDOC or RFC or Web Service.
RepeatingQueryMessage : Now you have to put a repeater the JCoMessage of the XML Document of Message Buffer in SAP MII because there can be more than one message in your Message Listener.
ReadMessage : In the Read Message Action Block, we have a property, which is Message ID, and in the XML of the Message Buffer in MII, all the JCo Message has a unique Message Id, so you just have to map the Message ID of the Read Message and the JCo Message ID, so, through Read Message we can get all the JCo Message ID of all the JCo Messages in that Message Buffer List XML as we have JCo Message in the Repeater before it.
So, After that you can print the ReadMessage's - MessageDocumentXML and will get the required IDOC or IDOCs of same name.
And, you can use JCo Action Blocks to send data back to ECC from MII through BAPI or custom RFC either with Single input parameters or Multiple input parameters.
Thanks and Regards,
Ushinar