<?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: Tab space in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400068#M193420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi vj,&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;FS1&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;DATA : L_STRING TYPE STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  DO 20 TIMES.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT SY-INDEX OF STRUCTURE ITAB TO &amp;lt;FS1&amp;gt;.&lt;/P&gt;&lt;P&gt;    IF SY-INDEX NE 1.&lt;/P&gt;&lt;P&gt;      CONCATENATE L_STRING &amp;lt;FS1&amp;gt; INTO L_STRING SEPARATED BY&lt;/P&gt;&lt;P&gt;      CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      L_STRING = &amp;lt;FS1&amp;gt;.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;  WRITE: / L_STRING.&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;Depending on the number of fields , you can change the count in the DO loop E.g. if you have 30 fields make it DO 30 times.&lt;/P&gt;&lt;P&gt;Using this even if the field is blank, there will be a tabspace for that field too..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Puneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jun 2006 21:56:48 GMT</pubDate>
    <dc:creator>Puneet_Gupta</dc:creator>
    <dc:date>2006-06-21T21:56:48Z</dc:date>
    <item>
      <title>Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400065#M193417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;my o/p will be each field seperated by tab space..when there is no value for any field then it should be seperated by tab space...how to do for below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS : c_tab TYPE x VALUE '09'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE lv_r_i&lt;/P&gt;&lt;P&gt;            lv_sp_id&lt;/P&gt;&lt;P&gt;            lv_sp_name&lt;/P&gt;&lt;P&gt;            lv_c_date&lt;/P&gt;&lt;P&gt;            lv_c_time&lt;/P&gt;&lt;P&gt;            lv_file_format&lt;/P&gt;&lt;P&gt;            lv_file_version&lt;/P&gt;&lt;P&gt;            INTO output_string1&lt;/P&gt;&lt;P&gt;    SEPARATED BY c_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; output_string1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 21:26:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400065#M193417</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T21:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400066#M193418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to put a value in there before concatenating.  SOme kind of placeholder.  You will need to check each field first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


CONSTANTS : c_tab TYPE x VALUE '09'.

if lv_r_i is initial.
lv_r_i = &amp;lt;placeholder&amp;gt;.
endif.

if lv_sp_id is initial.
lv_sp_id = &amp;lt;placeholder&amp;gt;.
endif.

.......


CONCATENATE lv_r_i
lv_sp_id
lv_sp_name
lv_c_date
lv_c_time
lv_file_format
lv_file_version
INTO output_string1
SEPARATED BY c_tab.

translate output_string1 '&amp;lt;placeholder&amp;gt; '.

WRITE :/ output_string1.



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 21:31:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400066#M193418</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-21T21:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400067#M193419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;I am using 30 fields ...for each if write &lt;/P&gt;&lt;P&gt;if lv_r_i is initial.&lt;/P&gt;&lt;P&gt;lv_r_i = &amp;lt;placeholder&amp;gt;.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;it will be lengthy...suggest any other code...&lt;/P&gt;&lt;P&gt;and what is that &amp;lt;placeholder&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 21:34:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400067#M193419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T21:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400068#M193420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi vj,&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;FS1&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;DATA : L_STRING TYPE STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  DO 20 TIMES.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT SY-INDEX OF STRUCTURE ITAB TO &amp;lt;FS1&amp;gt;.&lt;/P&gt;&lt;P&gt;    IF SY-INDEX NE 1.&lt;/P&gt;&lt;P&gt;      CONCATENATE L_STRING &amp;lt;FS1&amp;gt; INTO L_STRING SEPARATED BY&lt;/P&gt;&lt;P&gt;      CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      L_STRING = &amp;lt;FS1&amp;gt;.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;  WRITE: / L_STRING.&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;Depending on the number of fields , you can change the count in the DO loop E.g. if you have 30 fields make it DO 30 times.&lt;/P&gt;&lt;P&gt;Using this even if the field is blank, there will be a tabspace for that field too..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Puneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 21:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400068#M193420</guid>
      <dc:creator>Puneet_Gupta</dc:creator>
      <dc:date>2006-06-21T21:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400069#M193421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi puneet,&lt;/P&gt;&lt;P&gt;its very confusing ...can u write simple code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 22:24:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400069#M193421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T22:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400070#M193422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vj,&lt;/P&gt;&lt;P&gt;I am sorry if i confused you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same code that you are using should work.&lt;/P&gt;&lt;P&gt;Try this.. and let me know if it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE lv_r_i&lt;/P&gt;&lt;P&gt;lv_sp_id&lt;/P&gt;&lt;P&gt;lv_sp_name&lt;/P&gt;&lt;P&gt;lv_c_date&lt;/P&gt;&lt;P&gt;lv_c_time&lt;/P&gt;&lt;P&gt;lv_file_format&lt;/P&gt;&lt;P&gt;lv_file_version&lt;/P&gt;&lt;P&gt;INTO output_string1&lt;/P&gt;&lt;P&gt;SEPARATED BY cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; output_string1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Puneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 22:44:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400070#M193422</guid>
      <dc:creator>Puneet_Gupta</dc:creator>
      <dc:date>2006-06-21T22:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400071#M193423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was going to suggest that you do this dynamically as Puneet has suggested early, but I noticed that your fields are not part of a structure.  So, I would suggest putting them into a structure.  For example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of x,
      lv_r_i(20) type c,
      lv_sp_id(20) type c,
      lv_sp_name(20) type c,
      lv_c_date(20) type c,
      lv_c_time(20) type c,
      lv_file_format(20) type c,
      lv_file_version(20) type c,
      end of x.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put the values into this structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOw you can use this logic to put all the fields&lt;/P&gt;&lt;P&gt;into your string separated by the tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: l_string type string.
field-symbols: &amp;lt;fs1&amp;gt;.

DO  .
ASSIGN COMPONENT SY-INDEX OF STRUCTURE x TO &amp;lt;FS1&amp;gt;.
if sy-subrc &amp;lt;&amp;gt; 0.
exit.
endif.

if &amp;lt;fs1&amp;gt; is initial.
&amp;lt;fs1&amp;gt; = '%'.  " placeholder
endif.

IF SY-INDEX NE 1.
CONCATENATE L_STRING &amp;lt;FS1&amp;gt; INTO L_STRING SEPARATED BY
CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB.
ELSE.
L_STRING = &amp;lt;FS1&amp;gt;.
ENDIF.
ENDDO.

translate l_string using '% '.

write:/ l_string.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sense now?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 22:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400071#M193423</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-21T22:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400072#M193424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SEPARATED BY cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;/P&gt;&lt;P&gt;this statement is giving error ..i m using 4.6c&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 22:56:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400072#M193424</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T22:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400073#M193425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, this class does not exist in 46c,  so use the hex value, as you already have done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CONSTANTS : c_tab TYPE x VALUE '09'.



.....
separated by c_tab&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 22:59:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400073#M193425</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-21T22:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400074#M193426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vj,&lt;/P&gt;&lt;P&gt;I thought you were on 5.0.&lt;/P&gt;&lt;P&gt;For 4.6C , your original code should work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you tell me what is the exact problem that you are facing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Puneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 23:11:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400074#M193426</guid>
      <dc:creator>Puneet_Gupta</dc:creator>
      <dc:date>2006-06-21T23:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tab space</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400075#M193427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HEre is a test program which is working good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

data: begin of x,
      lv_r_i(20) type c,
      lv_sp_id(20) type c,
      lv_sp_name(20) type c,
      lv_c_date(20) type c,
      lv_c_time(20) type c,
      lv_file_format(20) type c,
      lv_file_version(20) type c,
      end of x.

data: l_string type string.
field-symbols: &amp;lt;fs1&amp;gt;.
CONSTANTS : c_tab TYPE x VALUE '09'.


* Fill the structure
x-lv_r_i = 'ABC'.
x-lv_sp_id = 'DEF'.
x-lv_sp_name = space .  "'GHI'. &amp;lt;--- Empty field
x-lv_c_date = 'JKL'.
x-lv_c_time = 'MNO'.
x-lv_file_format = 'PQR'.
x-lv_file_version = 'STU'.



do  .
  assign component sy-index of structure x to &amp;lt;fs1&amp;gt;.
  if sy-subrc &amp;lt;&amp;gt; 0.
    exit.
  endif.

* CHeck the field value, and provide a placeholder
  if &amp;lt;fs1&amp;gt; is initial.
    &amp;lt;fs1&amp;gt; = '%'.  " placeholder
  endif.

  if sy-index ne 1.
    concatenate l_string &amp;lt;fs1&amp;gt; into l_string
       separated by c_tab.
   else.
    l_string = &amp;lt;fs1&amp;gt;.
  endif.
enddo.

translate l_string using '% '.

write:/ l_string.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 23:12:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tab-space/m-p/1400075#M193427</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-21T23:12:17Z</dc:date>
    </item>
  </channel>
</rss>

