cancel
Showing results for 
Search instead for 
Did you mean: 

CSV to XML conversion issue.

Former Member
0 Kudos

Hi All,

I have an issue while converting CSV to XML file.

A single source .csv file is sent from SFTP folder which contains common field.

The source structure comes as

Message

     Message1

          MT_Data

               Status

                    Field1

                    Field2

                    Field3

                    Field4

The target structure contains 2 Message Types and is added in the mapping using Signature Tab. Hence in mapping the target looks something like

Message

     Message1

          MT_Header

               Record1

                    Field1

                    Field2

     Message2

          MT_Details

               Record2

                    Field3

                    Field4

I am using the below configuration in FCC.

Document Name: MT_Data

Recordset Structure: Status,*

Status.fieldSeparator          ;

Status.endSeparator          'nl'

Status.fieldNames              Field1,Field2,Field3,Field4

ignoreRecordsetName        true

After conversion the structure that I am getting in XML is

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

<ns:MT_Data xmlns:ns="urn:namepepsico:ariba:InvoiceStatusOut">

    <Status>

        <Field1>Field1, Field2, Field3, Field4</Field1>

    </Status>

    <Status>

        <Field1>"Foreign","Indian","Domestic","Internal"</Field1>

    </Status>

</ns:MT_Data>

Which is completely wrong.

I need the structure to be.

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

<ns:MT_Data xmlns:ns="urn:namepepsico:ariba:InvoiceStatusOut">

    <Status>

        <Field1>Foreign</Field1>

        <Field2>Indian</Field2>

        <Field3>Domestic</Field3>

        <Field4>Internal</Field4>

    </Status>

</ns:MT_Data>

Please help me identify my mistake.

Regards,

Shaibayan

Accepted Solutions (1)

Accepted Solutions (1)

Muniyappan
Active Contributor
0 Kudos

check below thread to skip the header.

looking at your output you have to user , as fieldSeparator.

to take care of double quotes check this.

http://scn.sap.com/thread/1825734

Converting File Content in a Sender Adapter (SAP Library - Partner Connectivity Kit)

Former Member
0 Kudos

Hi Muniyappan,

With the Document Offset option set to 1 the Header Line is gone however the structure remains the same.

It has now become

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

<ns:MT_Data xmlns:ns="urn:namepepsico:ariba:InvoiceStatusOut">

    <Status>

        <Field1>"Foreign","Indian","Domestic","Internal"</Field1>

    </Status>

</ns:MT_Data>

This is a part of it but the structure still is erroneous. It should be

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

<ns:MT_Data xmlns:ns="urn:namepepsico:ariba:InvoiceStatusOut">

    <Status>

        <Field1>Foreign</Field1>

        <Field2>Indian</Field2>

        <Field3>Domestic</Field3>

        <Field4>Internal</Field4>

    </Status>

</ns:MT_Data>

This is the Advantco SFTP adapter and not SAP SFTP so we have the Content Conversion tab

Muniyappan
Active Contributor
0 Kudos

Did you change "Status.fieldSeparator          ; "

you should give , instead of ;

also make sure you have below entries.

Status.enclosureSign="

if possible share your FCC configuration here.

Former Member
0 Kudos

Hi Muniyappan,

Changing ; to ,

and enclosureSign and enclosureSignEnd has resolved the issue.

Thanks a lot.

Regards,

Shaibayan

Muniyappan
Active Contributor
0 Kudos

Can you check if it works without giving enclosureSignEnd?

Answers (0)