<?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: cumulative quantity calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cumulative-quantity-calculation/m-p/7660049#M1573934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi K .Shivaraj Naik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first task, to find a matching entry, is trivial read table ... with key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second, finding a matching out of all possible combination, is funny and amazing. I think you need a mathematical approach to be solved with recursive calls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here a nice one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Take the value entered in selection screen&lt;/P&gt;&lt;P&gt;- construct all possible [Partition|http://en.wikipedia.org/wiki/Integer_partition]s&lt;/P&gt;&lt;P&gt;- For each partition: Check if you find the members in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to find a maximum of exactly one possible solution, then it goes (very rough &amp;amp; symbolic)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHILE NOT {combination found OR checked everything}
  clear stack
  WHILE {partition( next _member present in searchtab ) NE NIL}
    PUSH Partition member to stack
    Check sum( stack ) &amp;lt;&amp;gt; search value
  ENDWHILE.
ENDWHILE.
Get stack as solution&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 05 Feb 2011 20:50:05 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2011-02-05T20:50:05Z</dc:date>
    <item>
      <title>cumulative quantity calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cumulative-quantity-calculation/m-p/7660048#M1573933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ABAPers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am stuck with some problem. finding for a beter solution, hope anyone help me out in this.. the problem goes like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 25 entries in a table with different or same values....like...10, 20,30,10 or so..for 25 entries..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my need is....i will enter one value as input in the selection screen,  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this value should be searched with the above table entries. and it should display as 'entry found'...if the following conditions satisfy...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. it should match with either of the any table entry(value)&lt;/P&gt;&lt;P&gt;if single value doesnt match, then you need to check if any of the combinations of the table entries if u sum up, can match with entered value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex...if u enter 5 as input..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u need to check if the table has entries like this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5 or 1&lt;EM&gt;1&lt;/EM&gt;2&lt;EM&gt;1 or 3&lt;/EM&gt;2 or 2&lt;EM&gt;2&lt;/EM&gt;1 like this...if any of the combiations match..it should display..entry found...else...error.&lt;/P&gt;&lt;P&gt;and it should display what combination of entries was used to get  the  entered input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALL THE ABOVE THING, I AM DOING IN WORK ORDERS SPLITTING COnCEPT IN PP MODULE...if u have any suggestions or code...it wud help me further..thank you....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Feb 2011 14:38:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cumulative-quantity-calculation/m-p/7660048#M1573933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-05T14:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative quantity calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cumulative-quantity-calculation/m-p/7660049#M1573934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi K .Shivaraj Naik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first task, to find a matching entry, is trivial read table ... with key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second, finding a matching out of all possible combination, is funny and amazing. I think you need a mathematical approach to be solved with recursive calls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here a nice one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Take the value entered in selection screen&lt;/P&gt;&lt;P&gt;- construct all possible [Partition|http://en.wikipedia.org/wiki/Integer_partition]s&lt;/P&gt;&lt;P&gt;- For each partition: Check if you find the members in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to find a maximum of exactly one possible solution, then it goes (very rough &amp;amp; symbolic)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHILE NOT {combination found OR checked everything}
  clear stack
  WHILE {partition( next _member present in searchtab ) NE NIL}
    PUSH Partition member to stack
    Check sum( stack ) &amp;lt;&amp;gt; search value
  ENDWHILE.
ENDWHILE.
Get stack as solution&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Feb 2011 20:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cumulative-quantity-calculation/m-p/7660049#M1573934</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-02-05T20:50:05Z</dc:date>
    </item>
  </channel>
</rss>

