cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in file content conversion from XML to CSV

Former Member
0 Kudos

Hi Experts,

I am finding problem in file content conversion. I need to convert the following XML file into CSV file:

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

- <ns0:MT_CROSS_REF xmlns:ns0="urn:dabur:idoc2file:pos">

<Update_type>2</Update_type>

<PLU>00000000</PLU>

<Cross_ref_PLU>7777777</Cross_ref_PLU>

<Capture_PLU />

<Package_size />

<Package_desc />

</ns0:MT_CROSS_REF>

The output file data has to be like:

2,00000000,7777777,,,,

The problem I am facing is while specifying the content conversion parameters in communication channel i dont know what recordset structure i should mention as all the records are directly under root. If I mention recordset structure as "ns0:MT_CROSS_REF" and parameters as

ns0:MT_CROSS_REF.fieldSeparator ,

ns0:MT_CROSS_REF.endSeparator 'nl'

i get error in communication channel monitoring and no file is posted.

Please help me as to what correct parameter i should mention in my case.

Thanks,

Regards,

Yash

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

U can create one root element and under that root element u can use the below child strucutre.

and then write ur FCC as

Root.fieldSeparator etc...Try this i think it should work out for u...

Thnx

Chirag

Former Member
0 Kudos

Hi Chirag,

I cannot change the xml file as it comes after mapping idoc to a message type. How can I add ROOT in the xml? My message type is like MT_CROSS_REF and it has those 6 fields as in the XML (Update_type, PLU etc.). I do the mapping of these fields from a IDOC and get the XML.

I hope you got my point.

Thanks,

Yash

Former Member
0 Kudos

HI Yash,

You can change the strucutre form the Data type the way u have created the structure for Update_type, PLU etc.

Thnx

Chirag

Former Member
0 Kudos

Hi Chirag,

Now I am able to do it. I createtd a new data type as ROOT and used it in my main data type. Hence I got ROOT as structure in XML.

Thanks. I have awarded poitns too.

Yash