<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem with .csv file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496162#M1421030</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can achieve it in multiple steps. Firstly u need to have a new itab with a string typed variable like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step: 1&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;        document  TYPE string,&lt;/P&gt;&lt;P&gt;      END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step: 2&lt;/P&gt;&lt;P&gt;move ur comma seperated data into this itab through a loop and for the field which u feel has already a comma in it&lt;/P&gt;&lt;P&gt;write an if statement for it and move ur data in which u already have a comma to the itab without comma seperation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step: 3&lt;/P&gt;&lt;P&gt;Download this new itab as ur .csv file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it will work for u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Dec 2009 07:55:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-31T07:55:22Z</dc:date>
    <item>
      <title>problem with .csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496160#M1421028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am downloading the contents of my internal table into csv file by separating the contents with a ',' (comma).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, the problem is that if the data already has a comma, then the system treats it as a separator and causes a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to avoid this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 07:12:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496160#M1421028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T07:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: problem with .csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496161#M1421029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is a .csv file then we cannot have the , (comma) in between the data as it will be always treated as a separator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 07:46:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496161#M1421029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T07:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: problem with .csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496162#M1421030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can achieve it in multiple steps. Firstly u need to have a new itab with a string typed variable like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step: 1&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;        document  TYPE string,&lt;/P&gt;&lt;P&gt;      END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step: 2&lt;/P&gt;&lt;P&gt;move ur comma seperated data into this itab through a loop and for the field which u feel has already a comma in it&lt;/P&gt;&lt;P&gt;write an if statement for it and move ur data in which u already have a comma to the itab without comma seperation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step: 3&lt;/P&gt;&lt;P&gt;Download this new itab as ur .csv file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it will work for u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 07:55:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496162#M1421030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T07:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: problem with .csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496163#M1421031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Isn't there any way to handle a character in the data which is the same as the separator used while downloading data to a file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 08:56:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496163#M1421031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T08:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: problem with .csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496164#M1421032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never use delimiters in text files I always use fixed width.&lt;/P&gt;&lt;P&gt;I know this takes 10 minutes longer to program in the subsystem because you need to define the structure there and is a little bit less flexible but it always works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have probably already lost more time in finding a work around for the delimiter that is also used in your actual data fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution -&amp;gt; use fixed width alphanumeric text files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 09:28:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496164#M1421032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T09:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: problem with .csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496165#M1421033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My user insists on .csv file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if there is any solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 10:07:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496165#M1421033</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T10:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: problem with .csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496166#M1421034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- you may remove all commas or replace with another character&lt;/P&gt;&lt;P&gt;- you may enclose the fields with comma in quotes, like "field, with, comma", like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;field-symbols:
  &amp;lt;rec&amp;gt; type any,
  &amp;lt;fld&amp;gt; type any.
loop at itab assigning &amp;lt;rec&amp;gt;.
  do.
    assign component sy-index of structure &amp;lt;rec&amp;gt; to &amp;lt;fld&amp;gt;.
    if not sy-subrc = 0.
      exit."do loop
    endif.
    if &amp;lt;fld&amp;gt; ca ','.
      concatenate '"' &amp;lt;fld&amp;gt; '"' into &amp;lt;fld&amp;gt;. 
    endif.
  enddo.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excel will ignore the field delimiter , if it is enclosed in quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 17:31:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496166#M1421034</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2009-12-31T17:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: problem with .csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496167#M1421035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David, I have compiled rules to make "universal" CSV files (so that anybody in the world can open them using Excel 2003 and 2007) in this [wiki|http://wiki.sdn.sap.com/wiki/display/ABAP/Excel&lt;EM&gt;files&lt;/EM&gt;-&lt;EM&gt;CSV&lt;/EM&gt;format] (hope it's clear enough) where it shows the solution mentioned by Clemens.&lt;/P&gt;&lt;P&gt;It also shows that comma, as field separator, is not universally recognized.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2010 10:15:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-csv-file/m-p/6496167#M1421035</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2010-01-04T10:15:22Z</dc:date>
    </item>
  </channel>
</rss>

