cancel
Showing results for 
Search instead for 
Did you mean: 

Merging multiple idocs into 1 XML output

Former Member
0 Kudos

Hi Gurus,

I've got a scenario whereby i will need to send payment documents via idocs to XI and XI will output them into an XML file.

At the moment, when i perform a payment run for multiple vendors and send the idocs out, i realised that multiple idocs are being sent out and XI will output multiple XML docs.

Is there any way i can merged these idocs into a single XML document? The idocs are all from the same system.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

I think this is possible using PACKAGING.

Check this note 814393 on Service Market Place.

You want to create or process an XI message with multiple instances of an IDoc (of the same IDoc or extension type) in the mapping.

Please refer below link to follow the steps to Merge IDOCs under single XML,

SAP Network Blog: Collecting IDocs without using BPM

IDoc packaging

Reason and Prerequisites

The relevant IDoc is imported into the Integration Repository.

Solution

1) Log on to the Integration Repository.

2) Open the relevant IDoc in the object editor.

3) Select the "Export XSD" menu option in the "Tools" menu.

4) In the subsequent dialog box, assign a file name and save the data to the hard disk of your local PC.

5) Open the file that you have saved in step 4 in an adequate editor (for example, Notepad) for editing.

6) Locate the first entry: <xsd:element name="IDOC" type="<

Idocname>"> and add the following expression, maxOccurs="unbounded", between the value of the type attribute and the closing angular bracket.

Example:

<xsd:element name="IDOC" type="ADR2MAS.ADR2MAS02"

maxOccurs="unbounded">

7) Save the modified file to the hard disk of your local PC.

😎 In the message mapping, use the file saved in step 7 instead of the imported IDoc by using the "Import XML or XSD" function in the mapping tool to select the source or target messages.

Thnaks

swarup

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi....Yu Junyi,

Hope below link will help you.

Collecting multiple IDOCS using BPM.

Collecting multiple IDOCs without using BPM

Former Member
0 Kudos

Hi,

I'm lookin at the following weblog

as recommended.

If i'm only collecting 1 type of IDOC, do i still need the correlation step?

Former Member
0 Kudos

hi

when we are collecting all the idocs of one type then without BPM also we can do it,using standard prog: RSEOUT00 (assiging xml port etc..),then it be simple file to file scenario

regards

kummari

Former Member
0 Kudos

Hi,

If i generate the XML file, how do i send it automatically to XI?

Former Member
0 Kudos

Hi,

I'm now lookin at the BPM scenario.

I'm encountering an error at the Transformation Block. I put the CollectNOM1List as the Source Mesaage and when i try to activate, its giving me the following error

"Expression must not return a multiline value"

Not too sure why.

Any help will be much appreciated.

Former Member
0 Kudos

As you are collecting IDocs, you should use container of type Multiline to collect IDocs,

This multiline container will be source message in your transformation step.

Another important thingp is check your interface mapping, there your interfaces for IDocs (source) should have occurrence 0..unbounded

Former Member
0 Kudos

Hi,

I think the problem is with the interface mapping. I tried to set the source and target to unbounded but im hitting an activation error. The message mapping that im using is for Imported IDOC -> Imported External Definition (XSD File) and the occurences are all 1 and im unable to change them. Any way to go ard this problem?

thanks.

Former Member
0 Kudos

You have to set source occurrence only to 0..unbounded... target occurrence would be 1.

This you need to do in message mapping as well. Open message mapping, go to Messages tab, there you can change occurrence of source message to 0..unbounded

complete the mapping accordingly.. then in interface mapping you will be able to set occurrence of source interfaces

Former Member
0 Kudos

hi

As you said imported xsd...while importing change the occurance to unbounded for that particular idoc type...then impor that xsd..

also check whether your user id has assigned s_idoc_all and

b_ale_all while dealing with idocs

regards

kummari

Edited by: kummari on Aug 18, 2008 11:05 AM

Former Member
0 Kudos

Hi,

A multiline container element is a table comprising elements of the same type. For example, if you want to gather messages in a container element, you must define this element as a multiline container element.

you can be able to Accessing details from multiline object attribute..

You need to mark the checkbox multiline if the sender data will be comming to container with multiple records and have to imply the logic or to consider each records in container, you need to mark it as Multiline.

In the container create a containerElement that refers to an abstrakt interface.

Also check the checkbox "multiline"

Refer some of the links for useage of Multiline

Regards,

Nutan

Former Member
0 Kudos

hi,

The another method of collecting multiple idocs is to gather all the idocs with an xml format..without using BPM..then send this xml file using file adapter at sender side.

check the below blog for detailed steps

regards

kummari