<?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 Insert Space in CSV file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608866#M1663051</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am creating an CSV file using&amp;nbsp; SAP_CONVERT_TO_CSV_FORMAT and gui_download...Say for example i have 5 fields separated by&amp;nbsp; ' ; '&amp;nbsp; .Now i need to add empty space or Tab space for INITIAL fields. &lt;/P&gt;&lt;P&gt; I tried CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB , but not working . All my fields are char type&amp;nbsp; . &lt;/P&gt;&lt;P&gt; How can i insert space in for empty fields in CSV file&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 13:06:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-03-16T13:06:50Z</dc:date>
    <item>
      <title>Insert Space in CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608866#M1663051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am creating an CSV file using&amp;nbsp; SAP_CONVERT_TO_CSV_FORMAT and gui_download...Say for example i have 5 fields separated by&amp;nbsp; ' ; '&amp;nbsp; .Now i need to add empty space or Tab space for INITIAL fields. &lt;/P&gt;&lt;P&gt; I tried CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB , but not working . All my fields are char type&amp;nbsp; . &lt;/P&gt;&lt;P&gt; How can i insert space in for empty fields in CSV file&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 13:06:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608866#M1663051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-16T13:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Space in CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608867#M1663052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Unfortunately I think the FM SAP_CONVERT_TO_CSV_FORMAT does not care about spaces...&lt;/P&gt;&lt;P&gt;To do this I see two options: After calling SAP_CONVERT_TO_CSV_FORMAT and before calling GUI_DOWNLOAD, adapt you internal table accordingly (add spaces to initial fields).&lt;/P&gt;&lt;P&gt;Or do not use SAP_CONVERT_TO_CSV_FORMAT, but instead do the transformation by yourself (concatenate each field separated by ';' into a string table). This way you can really format your csv table the way you want.&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;Manu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 14:46:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608867#M1663052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-16T14:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Space in CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608868#M1663053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try by checking if a field of the output internal table is initial or not, before you convert it to CSV.&lt;/P&gt;&lt;P&gt;Try putting up some code together like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;DATA: &lt;SPAN class="L1S52"&gt;BEGIN&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;OF&lt;/SPAN&gt; it_data &lt;SPAN class="L1S52"&gt;OCCURS&lt;/SPAN&gt; &lt;SPAN class="L1S32"&gt;0&lt;/SPAN&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field1(&lt;SPAN class="L1S32"&gt;10&lt;/SPAN&gt;) &lt;SPAN class="L1S52"&gt;TYPE&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="L1S52"&gt;c&lt;/SPAN&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field2(&lt;SPAN class="L1S32"&gt;10&lt;/SPAN&gt;) &lt;SPAN class="L1S52"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;c&lt;/SPAN&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;END&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;OF&lt;/SPAN&gt; it_data.&lt;BR /&gt;&lt;SPAN class="L1S52"&gt;DATA&lt;/SPAN&gt;: wa_data &lt;SPAN class="L1S52"&gt;LIKE&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;LINE&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;OF&lt;/SPAN&gt; it_data.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L1S52"&gt;LOOP&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;AT&lt;/SPAN&gt; it_data &lt;SPAN class="L1S52"&gt;INTO&lt;/SPAN&gt; wa_data.&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L1S52"&gt;IF&lt;/SPAN&gt; wa_data-field1 &lt;SPAN class="L1S52"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;INITIAL&lt;/SPAN&gt;.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wa_data-field1 = cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L1S52"&gt;ENDIF&lt;/SPAN&gt;.&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L1S52"&gt;IF&lt;/SPAN&gt; wa_data-field2 &lt;SPAN class="L1S52"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;INITIAL&lt;/SPAN&gt;.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wa_data-field2 = cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L1S52"&gt;ENDIF&lt;/SPAN&gt;.&lt;BR /&gt;&lt;SPAN class="L1S52"&gt;ENDLOOP&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 15:23:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608868#M1663053</guid>
      <dc:creator>Shafiq_Rehman1</dc:creator>
      <dc:date>2012-03-16T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Space in CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608869#M1663054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &amp;lt;cannot copy your name&amp;gt;&lt;/P&gt;&lt;P&gt;After converting using SAP_CONVERT_TO_CSV_FORMAT:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DATA:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; lv_separator type string.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; `&amp;nbsp; `&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; `&amp;nbsp; `&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INTO &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;lv_separator."or what ever you prefer&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FIELD-SYMBOLS:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; &amp;lt;ANY&amp;gt; TYPE ANY.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOOP AT I_TAB_CONVERTED_DATA ASSIGNING &amp;lt;any&amp;gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*&amp;nbsp; REPLACE ALL OCCURRENCES OF ';;' WITH ';&amp;nbsp;&amp;nbsp;&amp;nbsp; ;'. "OR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*&amp;nbsp; REPLACE ALL OCCURRENCES OF ';;' WITH CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB. "OR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; REPLACE ALL OCCURRENCES OF ';' WITH &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;lv_separator.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ENDLOOP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Clemens&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 23:12:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-space-in-csv-file/m-p/8608869#M1663054</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2012-03-16T23:12:04Z</dc:date>
    </item>
  </channel>
</rss>

