Skip to Content
Author's profile photo Former Member

Sending out materials in 1 big IDOC (or not)

A while ago I had a requirement to send out Material Master data from SAP R/3 to a third party system.  In addition to this requirement I needed to send on big file with all materials in it, because the receiving system could not process it. So 2 options came across my mind:


  1. Send all IDOCs separately and create a BPM which collects all IDocs and then create an IDOC list.
  2. Send all materials in 1 big IDOC and just do a mapping.


I knew that option 1 was possible to do but I wanted to prevent creating a BPM as it was regarding a large volume of IDocs  and this could give performance issue’s.  So I started to see if option 2 was possible.


First step was exploring what the occurrences is for MATMAS05 for the master material segment (E1MARAM) . So with the help of transaction WE60 (Documentation for basic type), I saw that the occurrence was min number: 1, max. number:  9999. Meaning at least one and for a maximum of 9999. This was a good starting point, for the IDOC it was technically possible.


Then I started surfing on SDN and looked around if there was a similar program like transaction BD10 which could send out multiple materials in 1 IDoc. While looking on SDN,  I found forum post of users who wanted to do the same, but without satisfying answers.


Then I still thought how important is it to get one big IDoc instead of collecting them all, then I remembered a situation where I tried collecting IDocs and this was a pain.  So I decided to go on and  have a look in detail to program BD10.


In program RBDSEMAT for processing the MATERIALS the following function module is used: MASTERIDOC_CREATE_REQ_MATMAS. I started to look for a function module with a MASS extension which can send out one big IDOC. I found MASTERIDOC_CREATE_REQ_MATMASM.


Then it all came clear to be. Basically I needed to adopt small changes to the standard RBDSEMAT program. So I made a Z copy of it and did the following changes:


  1. Created an option to still be able to send 1 material per IDOC and to send multiple materials in 1 idoc.(added a parameter).
  2. Deleted the constant PACKAGE_SIZE_DIRECT.
  3. Created a parameter Num of materials per IDOC (used instead of the PACKAGE_SIZE_DIRECT with a maximum of 9999).
  4. Delete coding regarding the MACTOR IDoc


This solved al my issue’s, I am now getting one IDoc with all materials, this is send to SAP PI and mapped to the target.

While stress testing I noticed a couple of things:


  1. Make sure that the mapping will never fails.
  2. Performance in SAP PI is not bad, it takes several seconds to process an IDOC with 5000 materials.


In the end this again is a good example of finding all info which is needed on SDN and I am still wondering why there is no similar program in SAP R/3 😉

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      I believe you could have used txn MDM_CLNT_EXTR for mass extraction of master data objects from ECC, including material.
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi David,

      I have also looked into that transaction. The only thing is that I needed to have the materials based on selection criteria in the distribution model. So I needed to give in the message type, based on the message type in the distribution model data is being filtered out.

      Author's profile photo Former Member
      Former Member
      There is a idoc packaging feature available if you are in EHP1 , chk this blog - [original link is broken] [original link is broken]

      Hope it help you avoid custom coding.


      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Saravana,

      I have seen it and over here we are not using PI 7.1 but 7.0 so that was not an option too. But a good tip though, I needed to mantion it 😉

      Best regards,

      Guido Koopmann

      Author's profile photo Former Member
      Former Member
      Another option is to use a file port and write the IDOCs from ECC to a file, configure PI sender file adapter to pick up the idoc-xmls from the file. You could change the occurence of the IDOC node to 0..unbounded, import it as an xsdm use it as the source MT. That way you avoid custom 2 cents.