cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed in FILE CC

Former Member
0 Kudos

Hi All,

I am trying to convert XML to CSV(Content conversion in Receiver File adapter).

1. Here is the XML

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

<ns0:Emp_MT xmlns:ns0="http://sdn.com/XML_TO_CSV_01">

-


<Record>

-


<Name>David</Name>

-


<Sal>100</Sal>

-


</Record>

-


<Record>

-


<Name>Michal</Name>

-


<Sal>200</Sal>

-


</Record>

-


<Trailer>

-


<Flag>END_END</Flag>

-


</Trailer>

</ns0:Emp_MT>

2. My output need to be

David|100|

Michal|200|

END_END|

3.Content conversion

Recordset Structure = Record,*,Trailer,1

Record.endSeparator |

Record.fieldSeparator |

Trailer.endSeparator |

Trailer.fieldSeparator |

Record.addHeaderLine 0

I know I am doing wrong with CC. I went through the blog, but could not able to fix it. Can any one help me in fixing it.

Thank you

Ganges Leaves

Accepted Solutions (1)

Accepted Solutions (1)

former_member206604
Active Contributor
0 Kudos

Hi,

Try this and let me know.

Record.endSeparator 'nl'

Record.fieldSeparator |

Trailer.endSeparator 'nl'

Trailer.fieldSeparator |

Record.addHeaderLine 0

Thanks,

Prakash

Former Member
0 Kudos

Hi,

3.Content conversion

Recordset Structure = Record,*,Trailer,1

Change this to:

Recordset Structure = Record,Trailer

Regards

Vijaya

former_member206604
Active Contributor
0 Kudos

Hi,

Yes I agree with Vijaya and she is right.

Prakash

Answers (2)

Answers (2)

moorthy
Active Contributor
0 Kudos

Hi Ganges~

It is restricted in the Receiver File COntent conversion

Just try like this-

Recordset Structure - Record, Trailer

Record.endSeparator- 'nl'

Record.fieldSeparator- |

Record.fieldNames- Name,Sal

Trailer.endSeparator- 'nl'

Trailer.fieldSeparator- |

Trailer.fieldNames -Flag

More-

http://help.sap.com/saphelp_nw2004s/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm

Hope this helps,

Regards,

Moorthy

Former Member
0 Kudos

Hi Ganges,

you need to pass in content conversion the below parameters

Recordset Structure = Record,*,Trailer,1

Record.fieldNames - Name,Sal

Record.fieldSeparator - |

Trailer.fieldNames - Flag

Trailer.fieldSeparator - |

Record.fromConfiguration - YES

If above solution is not working then your XML Structure need to change as per below

-


The expected XML structure contains the structure as nodes filled with any number of elements without additional subnodes.

The expected document structure usually looks like this:

<root>...

<nameA>

<value1>value</value1>

<value2>value</value2>

<value3>value</value3>

</nameA>

<nameB>

<value4>value</value4>

</nameB>

...

</root>...

You can use any element names you like. There can be any number of different substructures under the root element, which can be mapped to different CSV structures.