<?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: Program to create .CSV file in Background mode in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265333#M1987407</link>
    <description>&lt;P&gt;There is nothing special to a CSV file: just open a file in text mode and write to it.&lt;/P&gt;&lt;P&gt;On the other hand, if you wish to write a proper Excel (non CSV) file in background, I suggest that you check out &lt;A href="https://github.com/sapmentors/abap2xlsx" target="_blank"&gt;abap2xlsx&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Nov 2020 18:11:52 GMT</pubDate>
    <dc:creator>abo</dc:creator>
    <dc:date>2020-11-19T18:11:52Z</dc:date>
    <item>
      <title>Program to create .CSV file in Background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265332#M1987406</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I need to create a .CSV file when running my program in background.&lt;/P&gt;
  &lt;P&gt;I did google search also but there is no staight forward answer. I am only seeing answer for foreground.&lt;/P&gt;
  &lt;P&gt;Can anyone please tell me. &lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 18:04:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265332#M1987406</guid>
      <dc:creator>ricky_shaw</dc:creator>
      <dc:date>2020-11-19T18:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Program to create .CSV file in Background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265333#M1987407</link>
      <description>&lt;P&gt;There is nothing special to a CSV file: just open a file in text mode and write to it.&lt;/P&gt;&lt;P&gt;On the other hand, if you wish to write a proper Excel (non CSV) file in background, I suggest that you check out &lt;A href="https://github.com/sapmentors/abap2xlsx" target="_blank"&gt;abap2xlsx&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 18:11:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265333#M1987407</guid>
      <dc:creator>abo</dc:creator>
      <dc:date>2020-11-19T18:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Program to create .CSV file in Background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265334#M1987408</link>
      <description>&lt;P&gt;In background mode, you cannot write file to foreground.&lt;/P&gt;&lt;P&gt;Workaround: store file in the server, and give user a custom app to retrieve this file from the server.&lt;/P&gt;&lt;P&gt;As simple as that.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 20:15:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265334#M1987408</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-11-19T20:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Program to create .CSV file in Background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265335#M1987409</link>
      <description>&lt;P&gt;Hi Again,&lt;/P&gt;&lt;P&gt;I am actually loop at my itab &amp;amp; using concatenating the fields separated by ','. &lt;/P&gt;&lt;P&gt;I can see the file in Al11 and then i had to download the file as .CSV.&lt;/P&gt;&lt;P&gt;Is this the right approach?&lt;/P&gt;&lt;P&gt;Code Snippet below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : filename(128) TYPE c VALUE '/sapxchange/IS/ce/out/reg.csv',

DATA : lv_str TYPE string, ls_datatab(600).

OPEN DATASET filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CONCATENATE 'Header' 'Pay ConnexionLoad' '20190802' 'IPM' 'PAY' INTO lv_str SEPARATED BY ','.
TRANSFER lv_str TO filename.

CONCATENATE 'UserProfile' '1236173000' 'JONES FAMILY LLC' INTO lv_str SEPARATED BY ','.
CLEAR lv_str.
CLOSE DATASET filename.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;After downloading i am seeing the File name &amp;amp; Directory details  on top 2 rows on left hand side of the file. How can i eliminate this as well?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 05:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265335#M1987409</guid>
      <dc:creator>ricky_shaw</dc:creator>
      <dc:date>2020-11-20T05:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Program to create .CSV file in Background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265336#M1987410</link>
      <description>&lt;P&gt;Please use the COMMENT button for comments, questions, adding details, replying to OP comment, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 08:23:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265336#M1987410</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-11-20T08:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Program to create .CSV file in Background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265337#M1987411</link>
      <description>&lt;P&gt;I don't understand your question. If you know what a CSV file is, then I don't see any difficulty in generating one? Or is it a question just about writing a file to AL11 with OPEN DATASET, TRANSFER and so on?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 08:25:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265337#M1987411</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-11-20T08:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Program to create .CSV file in Background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265338#M1987412</link>
      <description>&lt;P&gt;Obviously i am asking about writing a .CSV file to AL11 with OPEN DATASET, TRANSFER and open it as .CSV..&lt;/P&gt;&lt;P&gt;There is no rocket science in it. lol&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 15:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265338#M1987412</guid>
      <dc:creator>ricky_shaw</dc:creator>
      <dc:date>2020-11-20T15:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Program to create .CSV file in Background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265339#M1987413</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;ricky.shaw&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Here are some posts about creating a CSV file from internal table:&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/questions/1822772/how-to-create-csv-file.html" target="test_blank"&gt;https://answers.sap.com/questions/1822772/how-to-create-csv-file.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2014/09/09/understanding-csv-files-and-their-handling-in-abap/" target="test_blank"&gt;https://blogs.sap.com/2014/09/09/understanding-csv-files-and-their-handling-in-abap/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;From the second one you can take, that there is a class designed for handling a CSV file creation/read. This class is called CL_RSDA_CSV_CONVERTER. Using its method STRUCTURE_TO_CSV you can create a CSV line from a structure without worrying about value with double quotes or commas.&lt;/P&gt;&lt;P&gt;Then write the string value to a file on your server and you're done.&lt;/P&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Fri, 20 Nov 2020 15:26:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-to-create-csv-file-in-background-mode/m-p/12265339#M1987413</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-11-20T15:26:15Z</dc:date>
    </item>
  </channel>
</rss>

