on 06-30-2010 11:33 PM
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?
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]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tadd,
Did you try by using these three paramters:
.beginSeparator = "
.fieldSeparator = ","
.endSeparator = "'nl'
Then I think you should be good. The begin separator should start with double quotes and your field separator should be like what you want and the end separator ends with double quotes and a new line.
Try this out and let us know the updates.
If this doesn't work then I have other options in my mind like for each field you may con cat with double quotes and then you can use , as field separator. If this doesn't work then you can come up with a field for each start and end of double quotes and map with constant ". Here you might have more fields but your issue should be solved.
Regards,
---Satish
I did use all three, as you can see in the output.
Of course, I'm using the enclosing tag. I do not want to explicitly specify all the individual field elements as there are 22 of them, that would be quite a bit of time to setup. To be more detailed:
<users>
<user_info>
<firstname>Bob</firstname>
<lastname>Jenkins</lastname>
</user_info>
<user_info>
<firstname>Mike</firstname>
<lastname>Smith</lastname>
</user_info>
</users>
And my FCC is:
user_info.fieldSeparator = , (comma)
user_info.endSeparator = 'nl'
user_info.beginSeparator = " (double quotes)
Results in:
"Bob, Jenkins
"Mike, Smith
What am I doing wrong?
Hi Tadd,
Your FCC should be like this:
And my FCC is:
user_info.fieldSeparator = "," (doublequotes + comma + doublequotes)
user_info.endSeparator = "'nl' (doublequotes + newline)
user_info.beginSeparator = " (double quotes)
Dont put any space in between the characters. Try this and let us know the output. If you put the above parameters then i feel you should get:
"Bob","Jenkins"
"Mike"," Smith"
Regards,
---Satish
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the following content conversion parameter :
userinfo.enclosureSign = "
in your FCC.
Regards
Ravi Anand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use <fieldname>.enclosureSign = " in your Content conversion.
http://help.sap.com/saphelp_srm40/helpdata/ru/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Regards
Ramg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.