Skip to Content
0
Former Member
Nov 28, 2008 at 07:37 AM

How To Split message

20 Views

Hi all

I have A incoming IDOC:

<?xml version="1.0" encoding="UTF-8" ?>

- <CLSMAS04>

- <IDOC BEGIN="1">

- <EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

<MANDT>200</MANDT>

<DOCNUM>0000000000212289</DOCNUM>

<DOCREL>700</DOCREL>

<STATUS>30</STATUS>

<DIRECT>1</DIRECT>

<OUTMOD>2</OUTMOD>

<IDOCTYP>CLSMAS04</IDOCTYP>

<MESTYP>CLSMAS</MESTYP>

<SNDPOR>SAPECD</SNDPOR>

<SNDPRT>LS</SNDPRT>

<SNDPRN>ECDCLNT200</SNDPRN>

<RCVPOR>SAPXI</RCVPOR>

<RCVPRT>LS</RCVPRT>

<RCVPRN>XIDCLNT150</RCVPRN>

<CREDAT>20081127</CREDAT>

<CRETIM>144046</CRETIM>

<SERIAL>20081127144046</SERIAL>

</EDI_DC40>

- <E1KLAHM SEGMENT="1">

<MSGFN>004</MSGFN>

<KLART>026</KLART>

<CLASS>101</CLASS>

<STATU>1</STATU>

<ANAME>DPOLLOCK</ANAME>

<ADATU>20080617</ADATU>

<VDATU>00000000</VDATU>

<VONDT>20080617</VONDT>

<BISDT>99991231</BISDT>

<PRAUS>X</PRAUS>

<AUSGD>00000000</AUSGD>

<VERSD>00000000</VERSD>

<VERSI>00</VERSI>

<WWSKZ>0</WWSKZ>

- <E1SWORM SEGMENT="1">

<MSGFN>004</MSGFN>

<SPRAS>E</SPRAS>

<KLPOS>01</KLPOS>

<KSCHL>Edible Groceries</KSCHL>

<SPRAS_ISO>EN</SPRAS_ISO>

</E1SWORM>

- <E1DATEM SEGMENT="1">

<KEY_DATE>20081127</KEY_DATE>

</E1DATEM>

</E1KLAHM>

</IDOC>

</CLSMAS04>

I Need To split the xml file into 3 diffrent flat files depending on the value of the class element. If it is 101 I need to create file if 10101 I need to create different file if it is 1010101 I need to create a diffrent file.

Anyone know how I can achieve this?

Regards