0

We have a custom built legacy application that collects data from a SQL server database, builds an IDOC and then "sends" that IDOC to ECC. (This application was written in VB6 and uses the SAPGUI 6 SDK to accomplish this.)

I'm attempting to decommission this solution and replace it with a solution built in MII.

As far as I can tell I need to create the IDOC in MII using IDOC_Asynchronous_Inbound but I'm stuck at how I should populate the fields required.

IDOC_Asynchronous_Inbound has two segments: IDOC_CONTROL_REC_40 and IDOC_DATA_REC_40

I guessed which fields to fill in the IDOC_CONTROL_REC_40/item segment by looking at the source code of the old VB application. I think this should do:

IDOC_INBOUND_ASYNCHRONOUS/TABLES/IDOC_CONTROL_REC_40/item
- IDOCTYP: WMMBID01
- MESTYP: WMMBXY
- SNDPRN: <value>
- SNDPRT: LI
- SNDPOR: <value>
- RCVPRN: <value>
- RCVPRT: LS
- EXPRSS: X

Looking at the source code of the old VB app, I should now add a segment of type E1MBXYH with the following fields filled:

- BLDAT: <date>
- BUDAT: <date>
- TCODE: MB31
- XBLNR: <value>
- BKTXT: <value>

Based on guesswork and some blog posts, I'm guessing I have to add this segment as an item segment to the IDOC_DATA_REC_40 segment.

My guess is I should then add item segments of type E1MBXYI for all of the 'records' I'd like to send to SAP with the following fields:

- MATNR: <value>
- WERKS: <value>
- LGORT: <value>
- CHARG: <value>
- BWART: 261 
- ERFMG: <value>
- SHKZG: H
- ERFME: <value>
- AUFNR: <value>
- SGTXT: <value>

Now, looking at the IDOC_DATA_REC_40 segment in MII, these are the fields that are available:

- SEGNAM
- MANDT
- DOCNUM
- SEGNUM
- PSGNUM
- HLEVEL
- SDATA

My guess is that the segment name should go into SEGNAM and the data (properly structured/spaced) should go into SDATA. I'm not sure what I should put in the other fields (if anything). (I have the description file for this IDOC type so I know how to 'structure' the data I have to put in the SDATA segment... counting spaces, yay!)

To hopefully clarify how the IDOC should be structured, this is a (link to a) screenshot of an IDOC posted by the current VB application:

screenshot of an IDOC in SAP showing the data structure

I hope someone here can confirm I'm on the right track in filling the segments and that there's someone who knows which fields I should fill in the data segments.

Kind regards,

Thomas

P.S. Some of the resources consulted:

  1. How to create and send Idocs to SAP using SAP .Net Connector 3
  2. Goods movement IDOC SAP documentation
  3. How to send IDOCs from SAP MII to SAP ERP

P.P.S. Full disclosure: I've also posted this question on the SAP Community Questions & Answers board.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

2 Answers2

0

Correctly dealing with SAP IDocs is unfortunately not so easy as it looks at first glance. Maybe it would be a good idea to have a look at the SAP Java IDoc Class Library as mentioned here:

SAP .Net Connector 3.0 - How can I send an idoc from a non-SAP system?

Even if you would not like to switch to Java, it could be at least used as a reference example implementation in order to see how the Remote Function Modules have to be filled with the IDoc data to send.

The SAP Java IDoc Class Library can be downloaded together with the SAP Java Connector from here.

Trixx
  • 1,796
  • 1
  • 15
  • 18
0

I have no MII system by my side but you'd better thoroughly examine IDoc documentation rather than read the tea leaves. It can contain helpful hints how to fill one or another field of segment.

Go to WE60 and enter your segment names (IDOC_CONTROL_REC_40/IDOC_DATA_REC_40) or IDoc definition name IDOC_Asynchronous_Inbound.

enter image description here

It may not be very helpful but better than nothing.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90