<?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 need logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006637#M1345205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the logic below .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBELN           VBELP        LINENUMBER        Pecentage&lt;/P&gt;&lt;P&gt;6789              10               1                       80.00&lt;/P&gt;&lt;P&gt;6789              10               2                       20.00&lt;/P&gt;&lt;P&gt;6789              10               3                       80.00&lt;/P&gt;&lt;P&gt;6789              20               1                       80.00&lt;/P&gt;&lt;P&gt;6789              20               2                       10.00&lt;/P&gt;&lt;P&gt;6789              30               3                       80.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we need to calculate up to 100% or avilable Percentage(Not more tahn 100%) for that item, once it become 100%  we need left the remaning rows of the item...       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2009 07:19:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-31T07:19:11Z</dc:date>
    <item>
      <title>need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006637#M1345205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the logic below .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBELN           VBELP        LINENUMBER        Pecentage&lt;/P&gt;&lt;P&gt;6789              10               1                       80.00&lt;/P&gt;&lt;P&gt;6789              10               2                       20.00&lt;/P&gt;&lt;P&gt;6789              10               3                       80.00&lt;/P&gt;&lt;P&gt;6789              20               1                       80.00&lt;/P&gt;&lt;P&gt;6789              20               2                       10.00&lt;/P&gt;&lt;P&gt;6789              30               3                       80.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we need to calculate up to 100% or avilable Percentage(Not more tahn 100%) for that item, once it become 100%  we need left the remaning rows of the item...       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 07:19:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006637#M1345205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T07:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006638#M1345206</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;Try the following &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: v_percent type i,
         wa_itab like itab.
 
loop at itab.
v_ind = sy-tabix - 1.
 if v_percent &amp;lt; 100.
 read table itab into wa_itab index v_ind.
if itab-vbeln = wa_itab-vbeln and itab-vbelp = wa_itab-vbelp.
v_percent = itab-percentage.
itab-percentage = v_percent + itab-percentage.
modify itab.
endif.
endif.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: vikred on Jul 31, 2009 1:01 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 07:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006638#M1345206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T07:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006639#M1345207</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 looping on one internal table, you do your below logic to find the percentage for the document and line item.&lt;/P&gt;&lt;P&gt;In the loop, for every record, keep adding this percentage to one variable, and if this variable exceeds 100% then do consider this line items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pseudo code might be like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort t_vbap by vbeln vbelp.&lt;/P&gt;&lt;P&gt;loop at t_vbap into w_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at new vbelp.&lt;/P&gt;&lt;P&gt;clear w_item.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if w_item is initial.&lt;/P&gt;&lt;P&gt;w_percentage = w_percentage + w_vbap-percentage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if w_percentage &amp;gt; 100.&lt;/P&gt;&lt;P&gt;w_item = X.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at new vbeln.&lt;/P&gt;&lt;P&gt;clear w_percentage.&lt;/P&gt;&lt;P&gt;endat. &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 07:40:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006639#M1345207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T07:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006640#M1345208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ajai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" itab_new type itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort itab by vbeln.
loop at itab into wa.

at new VBELN.
clear temp_percentage.
endat.



temp_percentage = temp_percentage + wa-percentage.
if temp_percentage gt 100.
continue.
endif.
append wa to itab_new.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab_new will contained the desired data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 07:40:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006640#M1345208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T07:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: need logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006641#M1345209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello ajay ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just loop the data  into a internal table  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : percentage type &amp;lt; ur declation &amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pass the percentage field to variable percentage  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then  ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if percentage &amp;lt; 100  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab into wa_itab index idnx  .&lt;/P&gt;&lt;P&gt;append wa_itab  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif percentage &amp;gt; 100 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exit  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thnx &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Digviajy Rai&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the logic below .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBELN VBELP LINENUMBER Pecentage&lt;/P&gt;&lt;P&gt;6789 10 1 80.00&lt;/P&gt;&lt;P&gt;6789 10 2 20.00&lt;/P&gt;&lt;P&gt;6789 10 3 80.00&lt;/P&gt;&lt;P&gt;6789 20 1 80.00&lt;/P&gt;&lt;P&gt;6789 20 2 10.00&lt;/P&gt;&lt;P&gt;6789 30 3 80.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we need to calculate up to 100% or avilable Percentage(Not more tahn 100%) for that item, once it become 100% we need left the remaning rows of the item...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 07:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic/m-p/6006641#M1345209</guid>
      <dc:creator>digvijay_rai</dc:creator>
      <dc:date>2009-07-31T07:43:51Z</dc:date>
    </item>
  </channel>
</rss>

