<?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: strings in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124239#M986066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Converting this into itab n concatenating will not work..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you know the point at which you want to add a space (for example after every . (period)) the you can split it at . into itab and then concatenate them with space.&lt;/P&gt;&lt;P&gt;to add a space you can use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; ` ` &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Jul 2008 09:51:52 GMT</pubDate>
    <dc:creator>athavanraja</dc:creator>
    <dc:date>2008-07-01T09:51:52Z</dc:date>
    <item>
      <title>strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124238#M986065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi...i have a string in the following form and need to addd a few characters in middle and shift the rest. Can anybody help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input should be&lt;/P&gt;&lt;P&gt;A&lt;SUP&gt;abc&lt;/SUP&gt;bcde&lt;SUP&gt;fghi&lt;/SUP&gt;^^500.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output A&lt;SUP&gt;abc&lt;/SUP&gt;bcde&lt;SUP&gt;fghi&lt;/SUP&gt; ^^500. Note the space after the 4th ^ sign.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to traverse through the string and insert space, shift the rest of the sentence by one character. Converting this into itab n concatenating will not work..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 09:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124238#M986065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-01T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124239#M986066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Converting this into itab n concatenating will not work..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you know the point at which you want to add a space (for example after every . (period)) the you can split it at . into itab and then concatenate them with space.&lt;/P&gt;&lt;P&gt;to add a space you can use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; ` ` &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 09:51:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124239#M986066</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2008-07-01T09:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124240#M986067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried that thanks...i m looking for another logic as we write in c programs, taking the string as a character array, accessing each position, only thing that i dont know how to write tht using abap.!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 10:07:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124240#M986067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-01T10:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124241#M986068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;Please do it in this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;      l_str  TYPE string,&lt;/P&gt;&lt;P&gt;      l_str1 TYPE string,&lt;/P&gt;&lt;P&gt;      l_str2 TYPE string,&lt;/P&gt;&lt;P&gt;      l_str3 TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_str = 'A&lt;SUP&gt;abc&lt;/SUP&gt;bcde&lt;SUP&gt;fghi&lt;/SUP&gt;^^500'.&lt;/P&gt;&lt;P&gt;l_str1 = l_str(16).&lt;/P&gt;&lt;P&gt;l_str2 = l_str+16(5).&lt;/P&gt;&lt;P&gt;CONCATENATE l_str1 l_str2 INTO l_str3 SEPARATED BY space.&lt;/P&gt;&lt;P&gt;WRITE: / l_str3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 10:14:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124241#M986068</guid>
      <dc:creator>Subhankar</dc:creator>
      <dc:date>2008-07-01T10:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124242#M986069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this code:&lt;/P&gt;&lt;P&gt;REPORT zdemo LINE-SIZE 40 LINE-COUNT 10(4) no standard page&lt;/P&gt;&lt;P&gt;heading.&lt;/P&gt;&lt;P&gt;data len type i.&lt;/P&gt;&lt;P&gt;parameter : text type char100 lower case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;len = strlen( text ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Say u want to insert a space after 16th position.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;concatenate text&lt;EM&gt;0(16) text&lt;/EM&gt;16(len) into text in character mode&lt;/P&gt;&lt;P&gt;separated by space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 10:15:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124242#M986069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-01T10:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124243#M986070</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;You can check following piece of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: str1 TYPE string,&lt;/P&gt;&lt;P&gt;      str2 TYPE string,&lt;/P&gt;&lt;P&gt;      itab TYPE TABLE OF string,&lt;/P&gt;&lt;P&gt;      text TYPE string,&lt;/P&gt;&lt;P&gt;      v_len type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text = `A&lt;SUP&gt;abc&lt;/SUP&gt;bcde&lt;SUP&gt;fghi&lt;/SUP&gt;^^500`.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT text AT '^' INTO: TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;describe table itab lines v_len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into str1.&lt;/P&gt;&lt;P&gt;  if sy-tabix = v_len.&lt;/P&gt;&lt;P&gt;    concatenate str2 str1 into str2.&lt;/P&gt;&lt;P&gt;  elseif sy-tabix &amp;lt;&amp;gt; 5.&lt;/P&gt;&lt;P&gt;  concatenate str1 '^' into str1.&lt;/P&gt;&lt;P&gt;  concatenate str2 str1 into str2.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;   concatenate str1 ' ^' into str1.&lt;/P&gt;&lt;P&gt;   concatenate str2 str1 into str2.&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;write: / text.&lt;/P&gt;&lt;P&gt;write: / str2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 10:26:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124243#M986070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-01T10:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124244#M986071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
I have tried that thanks...i m looking for another logic as we write in c programs, taking the string as a character array, accessing each position, only thing that i dont know how to write tht using abap.!!
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you mean each char in the string as record in the itab if yes try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: string_tab type standard table of char01 ,
      input_string type string ,
      tlen type i .


      tlen = 1 .
      input_string = `this is for testing the string split function .` .

      CALL FUNCTION 'CONVERT_STRING_TO_TABLE'
        EXPORTING
          i_string               = input_string
          i_tabline_length       = tlen
        TABLES
          et_table               = string_tab .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 10:58:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/strings/m-p/4124244#M986071</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2008-07-01T10:58:12Z</dc:date>
    </item>
  </channel>
</rss>

