<?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: another problem with CSV FILE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/another-problem-with-csv-file/m-p/1616536#M276099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CSV files does not take space into consideration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Oct 2006 15:31:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-18T15:31:19Z</dc:date>
    <item>
      <title>another problem with CSV FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/another-problem-with-csv-file/m-p/1616535#M276098</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;I have a field called payee1 which has to be 40 In length.&lt;/P&gt;&lt;P&gt;Now I have added blanks/space after i get the field to make it 40 before I call the 'SAP_CONVERT_TO_CSV_FORMAT'. but then my temp table itab1 shows the same filed with no space and I end up with the exact field length in the csv and also I have payee2 which most of the time don't have any records but my csv should show it with 40 character space right. it doesn't.&lt;/P&gt;&lt;P&gt;here is my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: OUTFILE LIKE dxfile-filename &lt;/P&gt;&lt;P&gt;DEFAULT 'C:\Apositivepay.txt',&lt;/P&gt;&lt;P&gt;RUNDATE LIKE PAYR-LAUFD,&lt;/P&gt;&lt;P&gt;Bank LIKE T012K-HBKID. "List of Possible Banks&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;type-pools:TRUXS.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF OUTPUT_REC OCCURS 0, "Output file for USBANK&lt;/P&gt;&lt;P&gt;ACCT(12), "bank account no&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Payee1(40) type c,         "payee 1&lt;/P&gt;&lt;P&gt;Payee2(40) type c,         "payee 2&lt;/P&gt;&lt;P&gt;END OF OUTPUT_REC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab1 type TRUXS_T_TEXT_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_outputfile type string.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;SELECT * FROM PAYR WHERE HBKID = BANK&lt;/P&gt;&lt;P&gt;      AND RZAWE IN T_TYPE AND LAUFD = RUNDATE.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;MOVE: PAYR-ZNME1 TO OUTPUT_REC-PAYEE1.&lt;/P&gt;&lt;P&gt;PERFORM PAD_FIELD_ALPHA_40 USING OUTPUT_REC-PAYEE1.&lt;/P&gt;&lt;P&gt;MOVE: PAYR-ZNME2 TO OUTPUT_REC-PAYEE2.&lt;/P&gt;&lt;P&gt;PERFORM PAD_FIELD_ALPHA_40 USING OUTPUT_REC-PAYEE2.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;v_outputfile = OUTFILE.&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 = OUTPUT_REC&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;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = v_outputfile&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = itab1&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;FILE_OPEN_ERROR = 1&lt;/P&gt;&lt;P&gt;FILE_WRITE_ERROR = 2&lt;/P&gt;&lt;P&gt;INVALID_FILESIZE = 3&lt;/P&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 4&lt;/P&gt;&lt;P&gt;INVALID_TYPE = 5&lt;/P&gt;&lt;P&gt;NO_BATCH = 6&lt;/P&gt;&lt;P&gt;UNKNOWN_ERROR = 7&lt;/P&gt;&lt;P&gt;OTHERS = 8.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  PAD_FIELD_ALPHA_40&lt;/P&gt;&lt;P&gt;FORM PAD_FIELD_ALPHA_40 USING    P_NUM.&lt;/P&gt;&lt;P&gt;   DATA: L TYPE I, J TYPE I.&lt;/P&gt;&lt;P&gt;   L = STRLEN( P_NUM ).&lt;/P&gt;&lt;P&gt;   J = 40 - L.&lt;/P&gt;&lt;P&gt;   DO J TIMES.&lt;/P&gt;&lt;P&gt;      SHIFT P_NUM RIGHT.&lt;/P&gt;&lt;P&gt;   ENDDO.&lt;/P&gt;&lt;P&gt;   WHILE SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      REPLACE ' ' WITH ' ' INTO P_NUM.&lt;/P&gt;&lt;P&gt;   ENDWHILE.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " PAD_FIELD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 15:26:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/another-problem-with-csv-file/m-p/1616535#M276098</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T15:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: another problem with CSV FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/another-problem-with-csv-file/m-p/1616536#M276099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CSV files does not take space into consideration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2006 15:31:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/another-problem-with-csv-file/m-p/1616536#M276099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-18T15:31:19Z</dc:date>
    </item>
  </channel>
</rss>

