on 01-16-2008 2:02 PM
I have csv file which look like this
Name1,12,Address,"10,121.00",zip1
Name2,13,Address,"11,150.00",zip2
But the problem here is when xi reads it using file adapter the
amount field is taken as two parts even if i have mentioned in quotes
"10,121.00" - xi reads as "10 and 121.00"
How can i handle commas of an amount field in a csv file
Thanks
Sebin
Hi Sebin !
Have you tried:
(http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm)
-
● NameA.enclosureSign
Specify a string that acts as a text delimiter.
Text enclosed by such delimiters is transferred to the target structure unchanged, although the default setting is to remove all text delimiters. Separators within such texts are ignored.
This parameter is optional. The default setting is an empty value (no text delimiter).
● NameA.enclosureSignEnd
If the text delimiters for the beginning and end of the text are different, specify the text delimiter for the end of the text here.
If you do not make an entry here, the entry from NameA.enclosureSign is used.
● NameA.enclosureSignEscape
Specify a string that replaces the text delimiter if it occurs within a text that it delimits.
When the text is transferred the string is replaced by the value specified in NameA.enclosureSign .
● NameA.enclosureSignEndEscape
Specify a string that replaces the text delimiter for the end of the text if it occurs within a text that it delimits.
When the text is transferred the string is replaced by the value specified in NameA.enclosureSignEnd.
● NameA.enclosureConversion
To remove the delimiter upon transfer, or to replace it with escape characters, enter YES. This is the default value.
To transfer the characters unchanged enter NO.
Note
If you specify xml.enclosureSign= and xml.enclosureSignEsc=, text enclosed in quotation marks is transferred unchanged and the quotation marks are removed.
If the escape character for a quotation mark () occurs in the text itself, it is replaced by the quotation mark during the transfer.
-
Regards,
Matias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The FCC functionality of XI has the capability of identifying the commas but it cannot separate out any exception case. U have to handle this separately. There could be two options
1. Write an adapter module before processing of the FCC in the file adapter to chaneg it to some identifiable format say 10-121.00 and u may change it in mapping
2. Add a field in ur structure which can store the amount after comma. Afterin the mapping u may write some logic to concat it again
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The design is not a good one. Thats why the adapter module option is a better one. But it would be a bit time consuming. For the second option, u may proceed as follows:
1. Identify the maximum amount.
2. Create as many fields as there are commas in amount
3. When the amount is less, the other fields ll remain blank.
4. Concat all the fields in the end
Regards,
Prateek
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.