<?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 Simple Loop Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129548#M1818109</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been given this problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;Write a program that prompts the user for three values: a starting number, an ending number, and a &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;count by number. The program should then display the number sequence that results from beginning at the starting &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;number, counting by the count by number, and stopping when the ending number is hit or passed by. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;For example, if the user entered 2, 3, and 12 respectively, the program should display the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;Going from 2 to 12, counting by 3:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;2, 5, 8, 11&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the display to work by doing this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;PARAMETERS&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;start &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;end &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;count &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;WHILE &lt;/SPAN&gt;start &lt;SPAN class="L0S52"&gt;LE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;end&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;write&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;start &lt;SPAN class="L0S52"&gt;NO-GAP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;, &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;', '&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; start &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;start + &lt;SPAN class="L0S52"&gt;count&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDWHILE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;But can't figure out for the life of me how to not have the ending comma.&amp;nbsp; I know I should prob use SY-INDEX in an IF statement, and I've tried so many ways but can't figure it out.&amp;nbsp; I've now looked at it so much that I need an outsiders input.&amp;nbsp; Any help would be greatly appreciated!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Feb 2014 16:04:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-02-17T16:04:47Z</dc:date>
    <item>
      <title>Simple Loop Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129548#M1818109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been given this problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;Write a program that prompts the user for three values: a starting number, an ending number, and a &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;count by number. The program should then display the number sequence that results from beginning at the starting &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;number, counting by the count by number, and stopping when the ending number is hit or passed by. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;For example, if the user entered 2, 3, and 12 respectively, the program should display the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;Going from 2 to 12, counting by 3:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S31"&gt;2, 5, 8, 11&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the display to work by doing this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;PARAMETERS&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;start &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;end &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;count &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;WHILE &lt;/SPAN&gt;start &lt;SPAN class="L0S52"&gt;LE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;end&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;write&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;start &lt;SPAN class="L0S52"&gt;NO-GAP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;, &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;', '&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; start &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;start + &lt;SPAN class="L0S52"&gt;count&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDWHILE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;But can't figure out for the life of me how to not have the ending comma.&amp;nbsp; I know I should prob use SY-INDEX in an IF statement, and I've tried so many ways but can't figure it out.&amp;nbsp; I've now looked at it so much that I need an outsiders input.&amp;nbsp; Any help would be greatly appreciated!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 16:04:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129548#M1818109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-17T16:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Loop Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129549#M1818110</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;By no means the only way, but could you accumulate the output into a string rather than write it to the screen number by number?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would give you the option to manipulate the commas before writing the string to the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 16:15:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129549#M1818110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-17T16:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Loop Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129550#M1818111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashley,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work fine. &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/568/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: start TYPE i,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end TYPE i,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE start LE end.&lt;/P&gt;&lt;P&gt;if sy-index = 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp; write: start NO-GAP.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&amp;nbsp; write: ', ' NO-GAP, start NO-GAP.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; start = start + count.&lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Karthikeyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 16:15:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129550#M1818111</guid>
      <dc:creator>karthikeyan_p3</dc:creator>
      <dc:date>2014-02-17T16:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Loop Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129551#M1818112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 16:19:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129551#M1818112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-17T16:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Loop Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129552#M1818113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;welcome &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/568/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 16:21:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129552#M1818113</guid>
      <dc:creator>karthikeyan_p3</dc:creator>
      <dc:date>2014-02-17T16:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Loop Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129553#M1818114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;You can move it to a string as Nick told or you can just check an extra addition of count in start in another variable to check if it is the last iteration or not&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 16:21:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129553#M1818114</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2014-02-17T16:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Loop Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129554#M1818115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashley,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: start TYPE i,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end TYPE i,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF start LE end.&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITE start NO-GAP.&lt;/P&gt;&lt;P&gt;&amp;nbsp; start = start + count.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WHILE start LE end.&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITE: ', ' NO-GAP, start NO-GAP.&lt;/P&gt;&lt;P&gt;&amp;nbsp; start = start + count.&lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 16:25:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-loop-problem/m-p/10129554#M1818115</guid>
      <dc:creator>dirk_wittenberg</dc:creator>
      <dc:date>2014-02-17T16:25:48Z</dc:date>
    </item>
  </channel>
</rss>

