Skip to Content
avatar image
Former Member

File Content Conversion - Double Quotes on Output Fields

Experts - I was not able to find a scenario similar to mine via searching, perhaps you know a solution:

I need to create a CSV file with the structure:

"FIELDNAME1","FIELDNAME2","FIELDNAME3","FIELDNAME4"

"value1","value2","value3","value4"

"value1","value2","value3","value4"

From structure:

<userlist>

<userinfo>

<FIELDNAME1>value1</FIELDNAME1>

<FIELDNAME2>value2</FIELDNAME2>

<FIELDNAME3>value3</FIELDNAME3>

<FIELDNAME4>value4</FIELDNAME4>

</userinfo>

<userinfo>

<FIELDNAME1>value1</FIELDNAME1>

<FIELDNAME2>value2</FIELDNAME2>

<FIELDNAME3>value3</FIELDNAME3>

<FIELDNAME4>value4</FIELDNAME4>

</userinfo>

</userlist>

So, using the Content Conversion parameters:

userinfo.fieldSeparator = '0x09'

userinfo.addHeaderLine = 1

userinfo.endSeparator = 'nl'

So, using this configuration I can get the general structure, but without the double quotes around ALL values.

Is there a Content Conversion setting that can be used to enclose the output strings in double quotes?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 01, 2010 at 06:01 PM

    Thank you all for the quick feedback. Unfortunately using the enclosureSign parameter does not seem to work. In review of the documentation, it is stated that the enclosureSign is only available for use in the Sender configuration, not the Receiver File FCC.

    So we are back to where we started, it seems that SAP XI/PI does not support adding enclosure characters for creating a text document, only for text-to-XML. My proposed solution is to use an XSL mapping to add the required enclosure and then use simple FCC configuration to output the values. Is there a better approach?

    Receiver Configuration (PI 7.11):

    [http://help.sap.com/saphelp_nwpi711/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm]

    Sender Configuration (PI 7.11):

    [http://help.sap.com/saphelp_nwpi711/helpdata/en/44/6713ec3f914ddee10000000a1553f7/content.htm|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/6713ec3f914ddee10000000a1553f7/content.htm]

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thank you Satish. That did it. I have double quotes around all fields and it applied to the header as well. You saved me a lot of time. Many thanks.

  • avatar image
    Former Member
    Jul 01, 2010 at 06:11 AM

    I understand that you would like to get double quotes on the output strings.

    In the content conversion, use <NameA>.enclosureSign.

    Explanation of parameter <NameA>.enclosureSign : Specify a string here that acts as a text delimiter. Text enclosed by such delimiters is transferred to the target structure unmodified although the default setting is to remove all text delimiters. Separators within such texts are ignored.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 01, 2010 at 06:27 AM

    Hi,

    Use the following content conversion parameter :

    userinfo.enclosureSign = "

    in your FCC.

    Regards

    Ravi Anand

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 01, 2010 at 05:00 AM

    you can use <fieldname>.enclosureSign = " in your Content conversion.

    http://help.sap.com/saphelp_srm40/helpdata/ru/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

    Regards

    Ramg

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 11, 2015 at 06:02 AM

    Hello TADD,

    I am facing the same problem and when i used fieldSeparator as "," the data is getting converted.

    But the data is getting converted when i use Simple structure in recordset but not for Complex Structures.

    My Structure:

    Record

         Header  1

         Data      *

         Line     *

    When i use recordsetStructure = Header,1,Data,1,Line,1 it is working fine but when i use recordsetStructure = Header,1,Data,*,Line,* it is not working.

    Please help.

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded