<?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 in Text file Format while transferring data from SAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171579#M1371843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try with below code after OPEN DATA SET...&lt;/P&gt;&lt;P&gt; DO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;READ DATASET p_unixfn INTO lwa_file2.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; split the characters between the separators to individual fields.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        SPLIT lwa_file2 AT pa_sep INTO lwa_itab-field1&lt;/P&gt;&lt;P&gt;                                     lwa_itab-field2&lt;/P&gt;&lt;P&gt;                                    lwa_itab-field3&lt;/P&gt;&lt;P&gt;                                     lwa_itab-field4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;TRANSFER it_data TO p_unixfn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Oct 2009 13:03:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-07T13:03:54Z</dc:date>
    <item>
      <title>Problem in Text file Format while transferring data from SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171577#M1371841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am downloading the Text file with data on Unix server . But though i have two lines in internal table both the Lines are getting Concaniteted .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF it_data OCCURS 0,&lt;/P&gt;&lt;P&gt;       f1(250)  TYPE c,f2(250)  TYPE c,f3(250)  TYPE c, f4(250) TYPE c,&lt;/P&gt;&lt;P&gt;       f5(250)  TYPE c,f6(250)  TYPE c,f7(250)  TYPE c, f8(250) TYPE c,&lt;/P&gt;&lt;P&gt;       f9(250)  TYPE c,f10(250) TYPE c,f11(250) TYPE c, f12(250) TYPE c,&lt;/P&gt;&lt;P&gt;       f13(250) TYPE c,f14(250) TYPE c,f15(250) TYPE c, f16(250) TYPE c.&lt;/P&gt;&lt;P&gt;DATA : END OF it_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT it_download_bank_details INTO wa_download_bank_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND wa_download_bank_details TO it_data.&lt;/P&gt;&lt;P&gt;&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;OPEN DATASET p_unixfn FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;    errflag = 'X'.&lt;/P&gt;&lt;P&gt;    MESSAGE i002(mg) WITH p_unixfn.&lt;/P&gt;&lt;P&gt;    MESSAGE a099(mg).&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;  LOOP AT it_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRANSFER it_data TO p_unixfn.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      errflag = 'X'.&lt;/P&gt;&lt;P&gt;      MESSAGE i001(mg) WITH p_unixfn.&lt;/P&gt;&lt;P&gt;      MESSAGE a099(mg).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLOSE DATASET p_unixfn .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest me a solution.&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;Nilesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2009 10:39:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171577#M1371841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-07T10:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Text file Format while transferring data from SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171578#M1371842</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;1) instead of diclaring type c (250)  use  standerd data elements which needs to be moved into internal table other wise use atleast type CHAR250 . &lt;/P&gt;&lt;P&gt;f1(250) TYPE c,f2(250) TYPE c,f3(250) TYPE c, f4(250) TYPE c,&lt;/P&gt;&lt;P&gt;f5(250) TYPE c,f6(250) TYPE c,f7(250) TYPE c, f8(250) TYPE c,&lt;/P&gt;&lt;P&gt;f9(250) TYPE c,f10(250) TYPE c,f11(250) TYPE c, f12(250) TYPE c,&lt;/P&gt;&lt;P&gt;f13(250) TYPE c,f14(250) TYPE c,f15(250) TYPE c, f16(250) TYPE c.&lt;/P&gt;&lt;P&gt;DATA : END OF it_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) you need to take all the content into a single char field seperated by the delimitor.   check the below code for your reference&lt;/P&gt;&lt;P&gt;data:   w_file             type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Table for download&lt;/P&gt;&lt;P&gt;data: begin of t_file occurs 0,&lt;/P&gt;&lt;P&gt;        line(1000) type c.&lt;/P&gt;&lt;P&gt;data: end of t_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_fname2 like rlgrap-filename&lt;/P&gt;&lt;P&gt;                          default '/tmp/ordround.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  F0405_FILL_T_FILE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Description: This routine will fill the t_file table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form f0405_fill_t_file.&lt;/P&gt;&lt;P&gt;  free :  t_file.&lt;/P&gt;&lt;P&gt;  clear:  w_line.&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;P&gt;  w_h1  = text-009.&lt;/P&gt;&lt;P&gt;  w_h2  = text-012.&lt;/P&gt;&lt;P&gt;  w_h3  = text-015.&lt;/P&gt;&lt;P&gt;  w_h4  = text-018.&lt;/P&gt;&lt;P&gt;  w_h5  = text-021.&lt;/P&gt;&lt;P&gt;  w_h6  = text-024.&lt;/P&gt;&lt;P&gt;  w_h7  = text-026.&lt;/P&gt;&lt;P&gt;  w_h8  = text-029.&lt;/P&gt;&lt;P&gt;  w_h9  = text-032.&lt;/P&gt;&lt;P&gt;  w_h10 = text-034.&lt;/P&gt;&lt;P&gt;  w_h11 = text-036.&lt;/P&gt;&lt;P&gt;  w_h12 = text-038.&lt;/P&gt;&lt;P&gt;  w_h13 = text-040.&lt;/P&gt;&lt;P&gt;  w_h14 = text-043.&lt;/P&gt;&lt;P&gt;  w_h15 = text-046.&lt;/P&gt;&lt;P&gt;  w_h16 = text-049.&lt;/P&gt;&lt;P&gt;  w_h17 = text-052.&lt;/P&gt;&lt;P&gt;  w_h18 = text-055.&lt;/P&gt;&lt;P&gt;  w_h19 = text-058.&lt;/P&gt;&lt;P&gt;  w_h20 = text-055.&lt;/P&gt;&lt;P&gt;  w_h21 = text-061.&lt;/P&gt;&lt;P&gt;  w_h22 = text-055.&lt;/P&gt;&lt;P&gt;  w_h23 = text-063.&lt;/P&gt;&lt;P&gt;  w_h24 = text-055.&lt;/P&gt;&lt;P&gt;  w_ca1 = text-074.&lt;/P&gt;&lt;P&gt;  w_ca2 = text-077.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    concatenate w_h1(09)  w_h2(07)  w_h3(08)&lt;/P&gt;&lt;P&gt;                w_ca1(12) w_ca2(11) w_h4(05)&lt;/P&gt;&lt;P&gt;                w_h5(10)  w_h6(35)  w_h7(10)&lt;/P&gt;&lt;P&gt;                w_h8(35)  w_h9(20)  w_h10(07)&lt;/P&gt;&lt;P&gt;                w_h11(10) w_h12(12) w_h13(08)&lt;/P&gt;&lt;P&gt;                w_h14(19) w_h15(18) w_h16(40)&lt;/P&gt;&lt;P&gt;                w_h17(13) w_h18(03) w_h19(17)&lt;/P&gt;&lt;P&gt;                w_h20(03) w_h21(35) w_h22(03)&lt;/P&gt;&lt;P&gt;                w_h23(35) w_h24(03)&lt;/P&gt;&lt;P&gt;           into w_line&lt;/P&gt;&lt;P&gt;   separated by u2018|u2019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   move w_line to t_file-line.&lt;/P&gt;&lt;P&gt;  append t_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    unassign &amp;lt;fs_REPORT&amp;gt;.&lt;/P&gt;&lt;P&gt;    loop at T_REPORT assigning &amp;lt;fs_REPORT&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      clear: w_line,  &lt;/P&gt;&lt;P&gt;      concatenate  &amp;lt;fs_REPORT&amp;gt;-vkorg       &amp;lt;fs_REPORT&amp;gt;-vtweg&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-spart       &amp;lt;fs_REPORT&amp;gt;-vkbur&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-vkgrp       &amp;lt;fs_REPORT&amp;gt;-werks&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-kunnr       &amp;lt;fs_REPORT&amp;gt;-namesold&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-kunwe       &amp;lt;fs_REPORT&amp;gt;-nameship&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-bstnk       &amp;lt;fs_REPORT&amp;gt;-bsark&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-auart       &amp;lt;fs_REPORT&amp;gt;-vbeln&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-posnr       &amp;lt;fs_REPORT&amp;gt;-erdat&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-matnr       &amp;lt;fs_REPORT&amp;gt;-arktx&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-scmng       &amp;lt;fs_REPORT&amp;gt;-schme&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-kwmeng      &amp;lt;fs_REPORT&amp;gt;-vrkme&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-zzv_oriqty  &amp;lt;fs_REPORT&amp;gt;-vrkme&lt;/P&gt;&lt;P&gt;                   &amp;lt;fs_REPORT&amp;gt;-zzediqty    &amp;lt;fs_REPORT&amp;gt;-vrkme&lt;/P&gt;&lt;P&gt;              into w_line&lt;/P&gt;&lt;P&gt;      separated by u2018|u2019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      move w_line to t_file-line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      append t_file.&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.                    " F0405_FILL_T_FILE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  F0420_DOWNLOAD_UNIX&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Description: This routine will download the report to UNIX&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form f0420_download_unix.&lt;/P&gt;&lt;P&gt;  open dataset  p_fname2 for output in text mode encoding default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at t_file.&lt;/P&gt;&lt;P&gt;      transfer t_file to  p_fname2.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;    close dataset p_fname2.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;      message i999 with 'Error closing the file! '(066).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt; 	message i999 with 'Error opening the file!'(065).&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for any doughts preply me back .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2009 12:05:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171578#M1371842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-07T12:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Text file Format while transferring data from SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171579#M1371843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try with below code after OPEN DATA SET...&lt;/P&gt;&lt;P&gt; DO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;READ DATASET p_unixfn INTO lwa_file2.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; split the characters between the separators to individual fields.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        SPLIT lwa_file2 AT pa_sep INTO lwa_itab-field1&lt;/P&gt;&lt;P&gt;                                     lwa_itab-field2&lt;/P&gt;&lt;P&gt;                                    lwa_itab-field3&lt;/P&gt;&lt;P&gt;                                     lwa_itab-field4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;TRANSFER it_data TO p_unixfn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2009 13:03:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171579#M1371843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-07T13:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Text file Format while transferring data from SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171580#M1371844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Penchala ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for reply , but i am getting same format after opening the text file .&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;Nilesh Vakil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2009 13:09:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-text-file-format-while-transferring-data-from-sap/m-p/6171580#M1371844</guid>
      <dc:creator>nilesh_vakil</dc:creator>
      <dc:date>2009-10-07T13:09:01Z</dc:date>
    </item>
  </channel>
</rss>

