cancel
Showing results for 
Search instead for 
Did you mean: 

XI have to break/split XML-File into N times a XML Message

Former Member
0 Kudos

Hello,

Can anyone help with this one. I guess this is not an easy exercise but I need to solve it urgently.

XI gets a XML-file from a system.

This file has N times a element <XBT>.

Every time XI gets such a file the number of <XBT> is different.

XI haves to break this xml into N xml messages according to element ><XBT> in order to send them to Sap sequentially.

For example the following XML file have to split up into 2 xml files (the elements XBT occurs 2 times)

How can this be done?

<mt_BubaBestand>

<b><XBT></b>

<Algemeen>

<Verkooporganisatie>5000</Verkooporganisatie>

<Distributiekanaal>50</Distributiekanaal>

<Productgroep>50</Productgroep>

<Ordernummer>123123</Ordernummer>

<Verkoopgroep/>

<Documentdatum>20061207</Documentdatum>

<Medewerker_nr>e60217</Medewerker_nr>

<Medewerker_naam>Hermans</Medewerker_naam>

<CRM_nr/>

<CIFDedicated/>

<Klantgroep/>

</Algemeen>

<b></XBT></b>

<b><XBT></b>

<Algemeen>

<Verkooporganisatie>5000</Verkooporganisatie>

<Distributiekanaal>50</Distributiekanaal>

<Productgroep>50</Productgroep>

<Ordernummer>123123</Ordernummer>

<Verkoopgroep/>

<Documentdatum>20061207</Documentdatum>

<Medewerker_nr>e60217</Medewerker_nr>

<Medewerker_naam>Hermans</Medewerker_naam>

<CRM_nr/>

<CIFDedicated/>

<Klantgroep/>

</Algemeen>

<b></XBT></b>

</mt_BubaBestand>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

This can be done easily. Go thro this blog:

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

All you have to do is make your target message type as 0..unbounded.

Map the incoming XBT(unbounded) element to that.

Regards,

P.Venkat

Former Member
0 Kudos

Thanks Venkat,

This really looks good!

I going to try this. Do you know the option Exhanced takes care for the split?

If it works, full points for you.

Regards,

Luc

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

It sure does work. A very usefule feature.

Regards

Bhavesh

Answers (2)

Answers (2)

Former Member
0 Kudos

This is pretty standard procedure if you are posting these messages to R/3. As was pointed out in the weblogs above, when using IDocs you don't need to do any tricky configuration. Just make sure that your XML structure is set correctly (ie: 1 to unbounded, etc) to the limits that you want, and XI will automatically loop the mapping process for each instance of the <XBT> item that it detects in the source message. You mentioned:

<i>For example the following XML file have to split up into 2 xml files (the elements XBT occurs 2 times)</i>

Well, you don't actually split it into two XML files per say, XI just processes the source message straight to multiple IDocs using the IDoc adapter.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

if you use IDOCs you don't even need a BPM to do it

just use my blog:

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

and create a simple mapping that will do what you need

nothing more

Regards,

michal

Former Member
0 Kudos

Thanks for your answer.

But this is not what I mend

I would like to split up the file into multiple XML messages based on the tag <XBT>

not do a merge of one xml message into multiple messages.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Do you want to create a Single File or do you want to create Multiple Files as your output?

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

I would like to create single file<b>s</b> how many is based on the element <XBT>

Regards,

Luc

Former Member
0 Kudos

Hi,

As you said you want to create a single file.and you can use enhanced feature in interface determination.

See these are all on mapping and interface mapping.you have to split based on interface mapping . But here is you want to create a single file.

You mean each message should add as a record in target file ??

Any way you can use enhanced feature in receiver determination in ID.

And handle in Receiver Adapter also.by

http://help.sap.com/saphelp_nw2004s/helpdata/en/42/ed364cf8593eebe10000000a1553f7/content.htm

Regards

Chilla..

Former Member
0 Kudos

I just tested the Enhanced function in the Interface Determination and it works! Thanks it solved my question.

Regards,

Luc