on 09-03-2009 9:37 AM
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
Xin,
Go through the below threads, these could help you in someway.
Also find the help from the doument in below link.
http://help.sap.com/saphelp_erp2005/helpdata/en/f6/a72642d0d05333e10000000a155106/frameset.htm
-Suresh
Edited by: Suresh Hiremath on Sep 3, 2009 10:51 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
8 | |
7 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.