<?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: Efficient looping over strings in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/efficient-looping-over-strings/m-p/1597259#M268223</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 try this when it comes to converting things&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHILE myData IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;do something&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    myData = myData+1(*).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eddy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. &lt;/P&gt;&lt;P&gt;Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points. &lt;/P&gt;&lt;P&gt;Spread the wor(l)d!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Oct 2006 07:09:56 GMT</pubDate>
    <dc:creator>eddy_declercq</dc:creator>
    <dc:date>2006-10-02T07:09:56Z</dc:date>
    <item>
      <title>Efficient looping over strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/efficient-looping-over-strings/m-p/1597258#M268222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAPers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to loop over all the characters in a string. Here is the pseudo code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: myData TYPE string.
data: n TYPE i.
data: ch TYPE char1.

n = STRLEN( myData).
DO n TIMES.
  ch = myData(sy-index).
  ...
ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While this code would work, the problem is that I am actually iterating over myData two times. STRLEN itself is internally iterating over myData to compute the length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a more efficient looping mechanism without going through STRLEN?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 06:57:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/efficient-looping-over-strings/m-p/1597258#M268222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-02T06:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient looping over strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/efficient-looping-over-strings/m-p/1597259#M268223</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 try this when it comes to converting things&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHILE myData IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;do something&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    myData = myData+1(*).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eddy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. &lt;/P&gt;&lt;P&gt;Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points. &lt;/P&gt;&lt;P&gt;Spread the wor(l)d!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 07:09:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/efficient-looping-over-strings/m-p/1597259#M268223</guid>
      <dc:creator>eddy_declercq</dc:creator>
      <dc:date>2006-10-02T07:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient looping over strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/efficient-looping-over-strings/m-p/1597260#M268224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 07:35:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/efficient-looping-over-strings/m-p/1597260#M268224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-02T07:35:14Z</dc:date>
    </item>
  </channel>
</rss>

