<?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: Convert to *.CSV format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499798#M1064675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tan,&lt;/P&gt;&lt;P&gt;What u r seeing is correct only. When u open in notepad u can see the field seperator. But in excel this # menas that move that next data to # to next cell of excel. So don't worry.&lt;/P&gt;&lt;P&gt;If u want to see the data in excel also in single column then just comment    WRITE_FIELD_SEPARATOR         = '#'&lt;/P&gt;&lt;P&gt;of GUI_DOWNLOAD. It works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Sep 2008 05:40:01 GMT</pubDate>
    <dc:creator>vinod_vemuru2</dc:creator>
    <dc:date>2008-09-30T05:40:01Z</dc:date>
    <item>
      <title>Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499790#M1064667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All~~&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to convert a internal table to *.csv files, and set the seperator be ',' (not default value: ';' )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I call a function "SAP_CONVERT_TO_CSV_FORMAT", &lt;/P&gt;&lt;P&gt;and set the parameter "  I_FIELD_SEPERATOR  = ','  " .&lt;/P&gt;&lt;P&gt;But it's seems didn't work. &lt;/P&gt;&lt;P&gt;The seperator is ';' still.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So.... Maybe somebody can tell me how to do? Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 14:15:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499790#M1064667</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-29T14:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499791#M1064668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;define a string for output.&lt;/P&gt;&lt;P&gt;concatenate the fields of your internal table into string separated by ','&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 14:18:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499791#M1064668</guid>
      <dc:creator>former_member226519</dc:creator>
      <dc:date>2008-09-29T14:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499792#M1064669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: TRUXS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB_TEST OCCURS 0,&lt;/P&gt;&lt;P&gt;        COLU_A(10)  TYPE C,&lt;/P&gt;&lt;P&gt;        COLU_B(10)  TYPE C,&lt;/P&gt;&lt;P&gt;      END OF ITAB_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: Delimiter    TYPE CHAR01 VALUE ','.&lt;/P&gt;&lt;P&gt;DATA: Ouput_String TYPE TRUXS_T_TEXT_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*INITIALIZATION&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;  ITAB_TEST-COLU_A = 'TERENCE'.&lt;/P&gt;&lt;P&gt;  ITAB_TEST-COLU_B = 'TERENCE'.&lt;/P&gt;&lt;P&gt;  APPEND ITAB_TEST.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   I_FIELD_SEPERATOR              = Delimiter&lt;/P&gt;&lt;P&gt; TABLES&lt;/P&gt;&lt;P&gt;   I_TAB_SAP_DATA                    = ITAB_TEST&lt;/P&gt;&lt;P&gt; CHANGING&lt;/P&gt;&lt;P&gt;   I_TAB_CONVERTED_DATA       = Ouput_String&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   CONVERSION_FAILED          = 1&lt;/P&gt;&lt;P&gt;   OTHERS                               = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  WRITE: / 'Program failed to Convert data.'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the data still convertd into  "TERENCE;TERENCE" not "TERENCE,TAN"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 14:27:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499792#M1064669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-29T14:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499793#M1064670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead of FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab_test.&lt;/P&gt;&lt;P&gt;  concatenate itab_test-col1 itab_test-col2 into output_string&lt;/P&gt;&lt;P&gt;                     separated by delimiter.&lt;/P&gt;&lt;P&gt;  write: / output_string.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 14:42:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499793#M1064670</guid>
      <dc:creator>former_member226519</dc:creator>
      <dc:date>2008-09-29T14:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499794#M1064671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check this code.&lt;/P&gt;&lt;P&gt;It is working fine now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF ITAB_TEST OCCURS 0,
COLU_A(10) TYPE C,
COLU_B(10) TYPE C,
END OF ITAB_TEST.

DATA: Delimiter TYPE CHAR01 VALUE ','.
TYPES: BEGIN OF t_data,
        data(100) TYPE c,
        END OF t_data.
DATA: Ouput_String TYPE t_data OCCURS 0 WITH HEADER LINE.

INITIALIZATION.
DO 5 TIMES.
ITAB_TEST-COLU_A = 'TERENCE'.
ITAB_TEST-COLU_B = 'TERENCE'.
APPEND ITAB_TEST.
ENDDO.

START-OF-SELECTION.
LOOP AT ITAB_TEST.
CONCATENATE ITAB_TEST-COLU_A ITAB_TEST-COLU_B INTO Ouput_String-data
SEPARATED BY ','.
APPEND Ouput_String.
ENDLOOP.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
*   BIN_FILESIZE                  =
    filename                      = 'E:\test.csv'
*   FILETYPE                      = 'ASC'
*   APPEND                        = ' '
   WRITE_FIELD_SEPARATOR         = '#'
*   HEADER                        = '00'
*   TRUNC_TRAILING_BLANKS         = ' '
*   WRITE_LF                      = 'X'
*   COL_SELECT                    = ' '
*   COL_SELECT_MASK               = ' '
*   DAT_MODE                      = ' '
* IMPORTING
*   FILELENGTH                    =
  tables
    data_tab                      = Ouput_String[]
 EXCEPTIONS
   FILE_WRITE_ERROR              = 1
   NO_BATCH                      = 2
   GUI_REFUSE_FILETRANSFER       = 3
   INVALID_TYPE                  = 4
   NO_AUTHORITY                  = 5
   UNKNOWN_ERROR                 = 6
   HEADER_NOT_ALLOWED            = 7
   SEPARATOR_NOT_ALLOWED         = 8
   FILESIZE_NOT_ALLOWED          = 9
   HEADER_TOO_LONG               = 10
   DP_ERROR_CREATE               = 11
   DP_ERROR_SEND                 = 12
   DP_ERROR_WRITE                = 13
   UNKNOWN_DP_ERROR              = 14
   ACCESS_DENIED                 = 15
   DP_OUT_OF_MEMORY              = 16
   DISK_FULL                     = 17
   DP_TIMEOUT                    = 18
   FILE_NOT_FOUND                = 19
   DATAPROVIDER_EXCEPTION        = 20
   CONTROL_FLUSH_ERROR           = 21
   OTHERS                        = 22
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For test purpose i have declared occurs 0 and header line.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please avoid those in ur coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 14:46:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499794#M1064671</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-09-29T14:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499795#M1064672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you debug that FM, it always use ';' as a separator (doesn't matter what you choose). This is because it has this constant declaration inside the FM: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CONSTANTS: C_FIELD_SEPARATOR VALUE ';'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That it will use calling FM SAP_CONVERT_TO_TEX_FORMAT. You can try this FM though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you can achieve your goal like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab_test.
  CONCATENATE itab_test-colu_a delimiter itab_test-colu_b INTO ouput_string.
  APPEND ouput_string.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 14:47:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499795#M1064672</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-09-29T14:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499796#M1064673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;ype-pools:TRUXS.&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;vbeln like vbap-vbeln,&lt;/P&gt;&lt;P&gt;posnr like vbap-posnr,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;data:  itab1 type TRUXS_T_TEXT_DATA.&lt;/P&gt;&lt;P&gt;select vbeln&lt;/P&gt;&lt;P&gt;       posnr&lt;/P&gt;&lt;P&gt;       up to 10 rows&lt;/P&gt;&lt;P&gt;       from vbap&lt;/P&gt;&lt;P&gt;       into table itab.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt; I_FIELD_SEPERATOR          = ','&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt; I_TAB_SAP_DATA             = itab &lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt; I_TAB_CONVERTED_DATA       =  itab1&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt; CONVERSION_FAILED          = 1&lt;/P&gt;&lt;P&gt; OTHERS                     = 2          .&lt;/P&gt;&lt;P&gt; IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt; WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;P&gt;Try this one....&lt;/P&gt;&lt;P&gt;try to download this one in CSV format by Gui_download.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;bharani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 14:49:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499796#M1064673</guid>
      <dc:creator>BH2408</dc:creator>
      <dc:date>2008-09-29T14:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499797#M1064674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi~Vinod:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have another question that if I use MS-EXCEL to open the output test.csv files.&lt;/P&gt;&lt;P&gt;That data in EXCEL will be TWO columns:&lt;/P&gt;&lt;P&gt;Column_A   Column_B&lt;/P&gt;&lt;P&gt;TERENCE   TERENCE&lt;/P&gt;&lt;P&gt;TERENCE   TERENCE&lt;/P&gt;&lt;P&gt;TERENCE   TERENCE&lt;/P&gt;&lt;P&gt;TERENCE   TERENCE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use Notepad to open the files, it's will be right format: TERENCE,TERENCE&lt;/P&gt;&lt;P&gt;so, is it right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tan Terence on Sep 29, 2008 5:14 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tan Terence on Sep 29, 2008 5:38 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 15:13:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499797#M1064674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-29T15:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499798#M1064675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tan,&lt;/P&gt;&lt;P&gt;What u r seeing is correct only. When u open in notepad u can see the field seperator. But in excel this # menas that move that next data to # to next cell of excel. So don't worry.&lt;/P&gt;&lt;P&gt;If u want to see the data in excel also in single column then just comment    WRITE_FIELD_SEPARATOR         = '#'&lt;/P&gt;&lt;P&gt;of GUI_DOWNLOAD. It works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 05:40:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499798#M1064675</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-09-30T05:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to *.CSV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499799#M1064676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code it will convert any table for you into comma delimited ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Declaration&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; Types:&lt;/P&gt;&lt;P&gt;      begin of ty_utab,&lt;/P&gt;&lt;P&gt;      upfield1,&lt;/P&gt;&lt;P&gt;       upfield2,&lt;/P&gt;&lt;P&gt;      upfield3,&lt;/P&gt;&lt;P&gt;     --&lt;/P&gt;&lt;P&gt;     --&lt;/P&gt;&lt;P&gt;      upfieldn,&lt;/P&gt;&lt;P&gt;      end   of ty_utab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       begin of   ty_crtb,&lt;/P&gt;&lt;P&gt;       line  type string,&lt;/P&gt;&lt;P&gt;       end   of   ty_crtb.&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;     it_utab type table of ty_utab ,&lt;/P&gt;&lt;P&gt;     it_crtb type table of ty_crtb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     &lt;STRONG&gt;Perform&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;perform convert_comma_delimiter tables it_crtb it_utab.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Routine&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;form convert_comma_delimiter  tables   pt_crtb pt_utab.&lt;/P&gt;&lt;P&gt;  data: lw_crtb type string,&lt;/P&gt;&lt;P&gt;        lw_utab type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  field-symbols: &amp;lt;lw&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                 &amp;lt;line&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                 &amp;lt;crtb&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  create data lw_utab like line of pt_utab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  assign lw_utab-&amp;gt;* to &amp;lt;lw&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at pt_crtb assigning &amp;lt;crtb&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    assign component 'LINE' of structure &amp;lt;crtb&amp;gt; to &amp;lt;line&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform separate_comma using &amp;lt;line&amp;gt;&lt;/P&gt;&lt;P&gt;    changing &amp;lt;lw&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if &amp;lt;lw&amp;gt; is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      append &amp;lt;lw&amp;gt; to pt_utab.&lt;/P&gt;&lt;P&gt;      clear  &amp;lt;lw&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " CONVERT_COMMA_DELIMITER&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Routine&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;form separate_comma  using    pw_crtb&lt;/P&gt;&lt;P&gt;                     changing pw_utab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: lw_crtb type string,&lt;/P&gt;&lt;P&gt;        l_char1 type char255,&lt;/P&gt;&lt;P&gt;        l_char2 like l_char1,&lt;/P&gt;&lt;P&gt;        l_idx   type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  field-symbols: &amp;lt;lfs&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    l_idx = sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    find ',' in pw_crtb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      assign component l_idx of structure pw_utab to &amp;lt;lfs&amp;gt;.&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      split pw_crtb at ',' into &amp;lt;lfs&amp;gt; pw_crtb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      if pw_crtb is not initial.&lt;/P&gt;&lt;P&gt;        assign component l_idx of structure pw_utab to &amp;lt;lfs&amp;gt;.&lt;/P&gt;&lt;P&gt;        if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;          exit.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;          &amp;lt;lfs&amp;gt; = pw_crtb.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " SEPARATE_COMMA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 06:04:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-csv-format/m-p/4499799#M1064676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T06:04:39Z</dc:date>
    </item>
  </channel>
</rss>

