cancel
Showing results for 
Search instead for 
Did you mean: 

How to send an IDOC from MII to SAP?

Former Member
0 Kudos

Hi,

I would like to know to send an IDOC from MII to SAP. In some cases, we need to use an IDOC instead of BAPI in order to send data to SAP. How can we do it via MII?

Regards Xin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Xin,

Go through the below threads, these could help you in someway.

Also find the help from the doument in below link.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/201769e0-3174-2910-e287-baa58d198...

http://help.sap.com/saphelp_erp2005/helpdata/en/f6/a72642d0d05333e10000000a155106/frameset.htm

-Suresh

Edited by: Suresh Hiremath on Sep 3, 2009 10:51 AM

Former Member
0 Kudos

Hi Suresh,

Thanks for your answer.

But my question is how to send an IDOC from MII to SAP, not from SAP to MII. It is an Inbound IDOC I need send to SAP.

Regards Xin

Former Member
0 Kudos

Hi,

In below link you can get info on how you do the inbound processing of Idocs from other technologies it may be MII,EP etc.I think from MII HTTP Post and webservice might be the option. I'm not clear that how exactly we do the same in MII.

[Inbound Idoc Processing from Non-ABAP Technologies|http://help.sap.com/saphelp_erp2005/helpdata/en/dc/6b7ed443d711d1893e0000e8323c4f/content.htm]

Thanks,

Suresh

Former Member
0 Kudos

Hi,

you can use the RFC IDOC_INBOUND_ASYNCHRONOUS to send IDocs to SAP from MII.

SAP Help to tRFC:

[http://help.sap.com/saphelp_47x200/helpdata/en/dc/6b7eee43d711d1893e0000e8323c4f/frameset.htm]

IDoc Description:

[http://help.sap.com/saphelp_47x200/helpdata/en/1a/0e3842539911d1898b0000e8322d00/frameset.htm]

The trick is that you have to define in MII a structure that holds the idoc control data and the idoc "payload" data. Just use a JCO action in MII and configure the RFC IDOC_INBOUND_ASYNCHRONOUS so MII reads the XML structure. The structure looks like this:


<IDOC_INBOUND_ASYNCHRONOUS>
    <TABLES>
        <IDOC_CONTROL_REC_40>
            <item>
                <TABNAM>EDI_DC40</TABNAM>
                <MANDT>999</MANDT>
                <DOCNUM>9000000000000001</DOCNUM>
                ...
        </IDOC_CONTROL_REC_40>
        <IDOC_DATA_REC_40>
            <item>
                <SEGNAM>E1LTORH</SEGNAM>
                <MANDT/>
                <DOCNUM>9000000000000001</DOCNUM>
                <SEGNUM/>
                <PSGNUM/>
                <HLEVEL/>
                <SDATA>........your Payload data........</SDATA>
            </item>
        </IDOC_DATA_REC_40>
    </TABLES>
</IDOC_INBOUND_ASYNCHRONOUS>

The example shows the RFC structure. Use a unique DOCNUM in all tables. In the IDOC_DATA_REC_40 area you will define the IDoc segment you want to send, in the example above "E1LTORH". SDATA holds the contents of the IDOC as a string. You have to fill in the contents of all segment fields of the IDoc segment with their original length, because SAP overlays the string with the segment structure to import the values. You will know if the field lengths are correct, otherwise your contents will be displaced.

Hope this helps.

Michael

Former Member
0 Kudos

Hi Michael,

Thank you so much for your answer. It is very helpful.

Only one more question: I would like to send IDOC MBGBCR02 to SAP. There are 5 segment in this IDOC: E2MBGMCR, E2BP2017_GM_HEAD, , E2BP2017_GM_CODE, E2BP2017_GM_ITEM_CREATE and E2BP2017_GM_SERIALNUMBER. Should I create 5 segments <item> in IDOC_DATA_REC_40 segment, one for each IDOC segment and give the segment name in <SEGNAM>?

<IDOC_DATA_REC_40>

<item>

<SEGNAM>E2MBGMCR</SEGNAM>

<MANDT/>

<DOCNUM>9000000000000001</DOCNUM>

<SEGNUM/>

<PSGNUM/>

<HLEVEL/>

<SDATA>........your Payload data........</SDATA>

</item>

<item>

<SEGNAM>E2BP2017_GM_HEAD</SEGNAM>

<MANDT/>

<DOCNUM>9000000000000001</DOCNUM>

<SEGNUM/>

<PSGNUM/>

<HLEVEL/>

<SDATA>........your Payload data........</SDATA>

</item>

.....

</IDOC_DATA_REC_40>

Best Regards

Xin

Former Member
0 Kudos

Xin,

for every segment you want to send with your idoc, create an <item> under the <IDOC_DATA_REC_40> node. Take care that the docnum is the same in all items, because the docnum holds the segments together.

Michael

Former Member
0 Kudos

How to repeat the item tag in RFC IDOC_INBOUND_ASYNCHRONOUS . I wan to map each segemnt to one item in the IDOC_INBOUND_ASYNCHRONOUS .

Thanks

DUVVURUS

Former Member
0 Kudos

Duwurus,

first create a Local xml property with the same nodes as the item node of the RFC. Then fill the item node values. Finally use link mode Append XML to append the local item to the RFC. This way you can add as many item nodes as you like.

Michael

Answers (0)