cancel
Showing results for 
Search instead for 
Did you mean: 

Generate multiple idocs from one file with multiple line items.

Former Member
0 Kudos

Hi All,

I am doing File to IDOC scenario. The IDOC type we are using is MBGMCR03.

The file structure is as follows:

<File>

<Header>

-


</Header>

<Item>

---

</Item>

<Item>

---

</Item>

---

</File>

Now i want to genarate a new Idoc for each n every <Item> in the file. The Header Information is to be repeated for each IDOC as well.

Can anybody plz suggest me the approach? Is there any way to handle this thing in mapping only?

Thanks,

Atul

Accepted Solutions (1)

Accepted Solutions (1)

turmoll
Active Contributor
0 Kudos

> I am doing File to IDOC scenario. The IDOC type we are using is MBGMCR03.

> The file structure is as follows:

>

> <File>

> <Header>

> -


> </Header>

> <Item>

> ---

> </Item>

> <Item>

> ---

> </Item>

> ---

> </File>

> Now i want to genarate a new Idoc for each n every <Item> in the file. The Header Information is to be repeated for each IDOC as well.

> Can anybody plz suggest me the approach? Is there any way to handle this thing in mapping only?

Generally, when you import IDoc the occurrence is just 1, since by default you want to send one IDoc. Fortunately there is a trick that you can make use to achieve your goal - send many IDocs. It is described in SAP Note: [Note 814393 - Multiple IDoc instances in an XI message|https://service.sap.com/sap/support/notes/814393] or in Michal's blog: [XI: IDOC bundling - the trick with the occurrence change|/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change].

> I have created Datatype as u mentioned with appropriate occurances. However since i am importing IDOC structure from SAP and occurance of IDOC element is 1,1 i am unable map IDOC element to ITEM element.

Follow the descriptions provided in links i.e. save scheme of IDoc and change the occurrence.

Regards,

Jakub

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All,

Thanks for ur help.

I got error 'ATTRIBUTE_WRONG_INTF' because i was using My own Interface name. Instead we should use standard Idoc as interface. and in Message mapping we should use the modified XSD.

Very importantly in interface mapping the target interface should be standard idoc name and in message mapping we need to give our message mapping containing the modified XSD.

In config part we should follow our normal configuration steps using standard IDOC as receiver Interface.

Thanks,

Atul

Former Member
0 Kudos

Hi, Check the thread below, someone else had similar question and got resolved, IDOC is on the ABAP stack and can not do message splitting, therefore, one input file can not be splitted into multiple IDOCs

They adopted two mapping: file to file and file to IDOC, this way you split one file to mutiple IDOCs.

The other option is you can use Webservice:

File -XI - SOAP Receiver

SOAP Sender -> XI -> IDOC

in this case you SOAP receiver call SOAP sender.

You have to create webservice based on SOAP sender adapter

Liang

Edited by: Liang Ji on Apr 11, 2008 7:34 PM

Former Member
0 Kudos

Hi,

First of all import the idoc in XI, then take the idoc xsd and change the occurrence o..unbound and then create the external definition.

Look into this blog.

/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change

Now use the external definition in your mapping instead of using the original IDOC. In your mapping map the item to IDOC, and for header data you have to use the useOneAsMany function.

Regards,

Sarvesh

agasthuri_doss
Active Contributor
0 Kudos

Hi,

In Message Mapping can handle it, Make header 0-1 & Line item 0 - Unbound

Regards

Agasthuri Doss

Former Member
0 Kudos

Hi Agasthuri Doss,

I have created Datatype as u mentioned with appropriate occurances. However since i am importing IDOC structure from SAP and occurance of IDOC element is 1,1 i am unable map IDOC element to ITEM element.

Is there any other way of mapping it?

Thanks,

Atul.

agasthuri_doss
Active Contributor
0 Kudos

Hi,

Go to Imp[orted Objects then go to XSD tab.Upload to your Local system,Change the Occurence and again Load it

Regards

Agasthrui Doss