<?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 CSV file issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/csv-file-issue/m-p/8192436#M1625357</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i need to write internal table data into a CSV file and then put CSV file into application server and then my infopackage will read from the application server. Now i have my data in the internal table i have to write those records to a CSV file in the application server. I checked if there are any Function modules to convert internal table to .CSV file. The function module "sap_convert_to_csv_format" is not available in SAP BI server any other alternatives available. &lt;/P&gt;&lt;P&gt;The code that i used to create the file in application server is given below, please let me know if its fine.&lt;/P&gt;&lt;P&gt;REPORT Z_SAP_CONVERT_TO_CSV_FORMAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF XX,&lt;/P&gt;&lt;P&gt;NODE_ID TYPE N LENGTH 8,&lt;/P&gt;&lt;P&gt;INFOOBJECT TYPE C LENGTH 30,&lt;/P&gt;&lt;P&gt;NODENAME TYPE C LENGTH 60,&lt;/P&gt;&lt;P&gt;PARENT_ID TYPE N LENGTH 8,&lt;/P&gt;&lt;P&gt;END OF XX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : I_TAB LIKE STANDARD TABLE OF XX.&lt;/P&gt;&lt;P&gt;DATA: FILE_NAME TYPE RLGRAP-FILENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILE_NAME = './temp.CSV'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FILE_NAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '5'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-NODE_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = 'ZEMP_H'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-INFOOBJECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '5'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-NODENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '1'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-PARENT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND XX TO I_TAB.&lt;/P&gt;&lt;P&gt;CLEAR XX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '6'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-NODE_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = 'ZEMP_H'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-INFOOBJECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '6'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-NODENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '1'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-PARENT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND XX TO I_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT I_TAB INTO XX.&lt;/P&gt;&lt;P&gt;TRANSFER XX TO FILE_NAME.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET FILE_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need to put any character for "data separtor" and "escape sign"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message : Duplicate post locked. &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Warning : Non-adherence of forum rules will lead to deletion of user-id. &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinod Kumar on Sep 8, 2011 4:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Sep 2011 10:03:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-09-08T10:03:12Z</dc:date>
    <item>
      <title>CSV file issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/csv-file-issue/m-p/8192436#M1625357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i need to write internal table data into a CSV file and then put CSV file into application server and then my infopackage will read from the application server. Now i have my data in the internal table i have to write those records to a CSV file in the application server. I checked if there are any Function modules to convert internal table to .CSV file. The function module "sap_convert_to_csv_format" is not available in SAP BI server any other alternatives available. &lt;/P&gt;&lt;P&gt;The code that i used to create the file in application server is given below, please let me know if its fine.&lt;/P&gt;&lt;P&gt;REPORT Z_SAP_CONVERT_TO_CSV_FORMAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF XX,&lt;/P&gt;&lt;P&gt;NODE_ID TYPE N LENGTH 8,&lt;/P&gt;&lt;P&gt;INFOOBJECT TYPE C LENGTH 30,&lt;/P&gt;&lt;P&gt;NODENAME TYPE C LENGTH 60,&lt;/P&gt;&lt;P&gt;PARENT_ID TYPE N LENGTH 8,&lt;/P&gt;&lt;P&gt;END OF XX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : I_TAB LIKE STANDARD TABLE OF XX.&lt;/P&gt;&lt;P&gt;DATA: FILE_NAME TYPE RLGRAP-FILENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILE_NAME = './temp.CSV'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FILE_NAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '5'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-NODE_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = 'ZEMP_H'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-INFOOBJECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '5'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-NODENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '1'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-PARENT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND XX TO I_TAB.&lt;/P&gt;&lt;P&gt;CLEAR XX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '6'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-NODE_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = 'ZEMP_H'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-INFOOBJECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '6'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-NODENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;INPUT = '1'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = XX-PARENT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND XX TO I_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT I_TAB INTO XX.&lt;/P&gt;&lt;P&gt;TRANSFER XX TO FILE_NAME.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET FILE_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need to put any character for "data separtor" and "escape sign"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message : Duplicate post locked. &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Warning : Non-adherence of forum rules will lead to deletion of user-id. &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinod Kumar on Sep 8, 2011 4:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 10:03:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/csv-file-issue/m-p/8192436#M1625357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-08T10:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: CSV file issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/csv-file-issue/m-p/8192437#M1625358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;CSV file means file having comma seperated values.  You dont have to convert anything.  Just open a .CSV file and transfer comma seperated values into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep semicolon ( &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt; as seperator for each field in same row.  And then transfer this to the file opened.  This will solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT I_TAB INTO XX.
CONCATENATE xx-field1 xx-field2........ INTO wa_data SEPERATED BY ';'.
TRANSFER wa_data TO FILE_NAME.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 10:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/csv-file-issue/m-p/8192437#M1625358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-08T10:12:11Z</dc:date>
    </item>
  </channel>
</rss>

