<?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 Problem in Checking and Incrementing while Looping in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-checking-and-incrementing-while-looping/m-p/4205711#M1005111</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See I have this problem I have table A and Table B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say for example,Table A  has field customer of,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And table b has field customer of,&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am suppose to compare A with B if A has a customer number equal to one of the values in B. It has to increment until it reaches a number not available in B. so in table A 1 is ok. 2 as well. but 3 has to be incremented to 7. 4 is next from table A next available is 7, but im suppose to make the customer field unique so next increment is 8. How do I go about doing this. Having a hard time checking while looping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jul 2008 07:22:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-15T07:22:52Z</dc:date>
    <item>
      <title>Problem in Checking and Incrementing while Looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-checking-and-incrementing-while-looping/m-p/4205711#M1005111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See I have this problem I have table A and Table B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say for example,Table A  has field customer of,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And table b has field customer of,&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am suppose to compare A with B if A has a customer number equal to one of the values in B. It has to increment until it reaches a number not available in B. so in table A 1 is ok. 2 as well. but 3 has to be incremented to 7. 4 is next from table A next available is 7, but im suppose to make the customer field unique so next increment is 8. How do I go about doing this. Having a hard time checking while looping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2008 07:22:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-checking-and-incrementing-while-looping/m-p/4205711#M1005111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-15T07:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Checking and Incrementing while Looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-checking-and-incrementing-while-looping/m-p/4205712#M1005112</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;In the loop you can have the value in a seprate variable which you are updating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort A by customer number descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_custno = a-custno. ( This will have value as 6 )&lt;/P&gt;&lt;P&gt;v_custno = v_custno + 1.&lt;/P&gt;&lt;P&gt;Loop at A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table b with key custno = A-custno.&lt;/P&gt;&lt;P&gt;if sy-subrc is initial.&lt;/P&gt;&lt;P&gt;A-custno = v_custno.&lt;/P&gt;&lt;P&gt;v_custno = v_custno + 1.&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;Hope this logic shud meet your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2008 07:30:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-checking-and-incrementing-while-looping/m-p/4205712#M1005112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-15T07:30:47Z</dc:date>
    </item>
  </channel>
</rss>

