<?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: code with minimal loops in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112447#M106534</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ravi kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have cant use loop at order quantity and read in batch quantity.&lt;/P&gt;&lt;P&gt;because the batchqtu has multiple values for one orderqty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you have to use two loop statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at orderqty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at batchqty where plant eq orderqty-plant and material eq orderqty-material and storageloc eq orderqty-storageloc and shelfexpdate lt goodissdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;your logic&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;kishore&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Feb 2006 09:35:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-23T09:35:13Z</dc:date>
    <item>
      <title>code with minimal loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112445#M106532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; i have a requirement to process two internal tables in which  i should update these two internal tables based on the conditions and for your convenience i'm describing the scenario in detail below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.batchquantity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plant|material|storageloc|batchqty|shelfexp.date|orderqty|&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------" /&gt;&lt;P&gt;00100|10000000|0000000010|00000100|02/06/2009___|___0____|&lt;/P&gt;&lt;P&gt;00100|10000000|0000000010|00000150|02/06/2003___|___0____|&lt;/P&gt;&lt;P&gt;00100|10000000|0000000010|00000500|02/06/2010___|___10___|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.orderqty &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plant|material|storageloc|orderqty|goodsiss.date|&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;00100|10000000|0000000010|00000150|02/06/2008___|&lt;/P&gt;&lt;P&gt;00100|10000000|0000000010|00000300|02/06/2001___|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my requirment is that for orderqty-goodsiss.date &amp;lt; batchqty-shelfexpdate,&lt;/P&gt;&lt;P&gt;i need to distribute the orderqty in orderqty table to orderqty in batchquantity table&lt;/P&gt;&lt;P&gt;based on plant, material, storage loc... and the orderqty in batchqty table should not exceed batchqty in the same table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result would be as follows in batchqty table( orderqty increased since the date condition matched and cannot go beyond the batchqty)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plant|material|storageloc|batchqty|shelfexp.date|orderqty|&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------" /&gt;&lt;P&gt;00100|10000000|0000000010|00000100|02/06/2009___|___100__|  &amp;lt;---&lt;/P&gt;&lt;P&gt;00100|10000000|0000000010|00000150|02/06/2003___|___0____|&lt;/P&gt;&lt;P&gt;00100|10000000|0000000010|00000500|02/06/2010___|___60___|  &amp;lt;---&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and orderqty would be ( the orderqty reduced since it got into batchqty tab)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plant|material|storageloc|orderqty|goodsiss.date|&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;00100|10000000|0000000010|00000000|02/06/2008___|   &amp;lt;----&lt;/P&gt;&lt;P&gt;00100|10000000|0000000010|00000300|02/06/2001___|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There might be several thousand records in both the tables, how to update the batchqty table&lt;/P&gt;&lt;P&gt;with minimum loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;ravi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 07:14:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112445#M106532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T07:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: code with minimal loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112446#M106533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best method to me seems to loop at the batch quantity table and read from the order qty table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, since both the itabs are created for the Plant/material/Sloc combination, would it not be easier to combine the two itabs and filter out the data, instead of trying to merge two differnt itabs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 09:02:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112446#M106533</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T09:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: code with minimal loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112447#M106534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ravi kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have cant use loop at order quantity and read in batch quantity.&lt;/P&gt;&lt;P&gt;because the batchqtu has multiple values for one orderqty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you have to use two loop statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at orderqty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at batchqty where plant eq orderqty-plant and material eq orderqty-material and storageloc eq orderqty-storageloc and shelfexpdate lt goodissdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;your logic&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;kishore&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 09:35:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112447#M106534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T09:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: code with minimal loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112448#M106535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ravi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proceed like this ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. u said (order qty vs batch qty) should not exceed  &lt;/P&gt;&lt;P&gt;means to say order qty (max value) in batchqty table is the batch qty in the same table .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;here1. loop at batchaty.&lt;/P&gt;&lt;P&gt;if batchqty-orderqty &amp;gt; batchqty-batchqty .&lt;/P&gt;&lt;P&gt;      delete table  entries from batch batchqty .&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;now sort batchqty/orderqty based on the plant etc etc..&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt; loop at batchqty&lt;/P&gt;&lt;P&gt;  read table batchqty with key plant = orderqty-plant &lt;/P&gt;&lt;P&gt;                               mat  = orderqty-mat &lt;/P&gt;&lt;P&gt;                             location = orderqty-location&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  if ordqty-GIdate &amp;lt; batchqty-EXPdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     |  if itordqty-orderqty &amp;gt; itbatchqty-batqty.&lt;/P&gt;&lt;P&gt;     | itbatchqty-ordqty = itbatchqty-batchqty      &lt;/P&gt;&lt;P&gt;     |   else.&lt;/P&gt;&lt;P&gt;     |  itbatchqty-ordqty = itorderqty-orderqty.&lt;/P&gt;&lt;P&gt;     |  endif. &lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;P&gt;    move it it_ordqty to itbatcqty-ordqty.&lt;/P&gt;&lt;P&gt;append itbatchqty or modify itbatchqty index cntr .&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;  if ur trying to modify the existing table tbatchqty then proceed with a cntr varaible as this may involve items also .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;cntr = sy-tabix.&lt;/P&gt;&lt;P&gt; modify table itbatchqty index cntr.&lt;/P&gt;&lt;P&gt;_____________________________________________________&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 12:42:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112448#M106535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T12:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: code with minimal loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112449#M106536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know I sound like a broken record, but have a look at this &amp;lt;a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 15:18:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-minimal-loops/m-p/1112449#M106536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-23T15:18:56Z</dc:date>
    </item>
  </channel>
</rss>

