<?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 Logic using at new stmt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070517#M1178044</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  In my scenario have to write a code with the following logic.&lt;/P&gt;&lt;P&gt;consider in the internal table have the values of vendor,docu num ,buzei and amt.&lt;/P&gt;&lt;P&gt;my logic is if the 1st vendor comes in the loop have to count the line items and check for some codn next thing is check for 2nd vendor.Have written the coding as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT gt_bsik.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      wa_bsik = gt_bsik.&lt;/P&gt;&lt;P&gt;      AT NEW  lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_sum = 0.&lt;/P&gt;&lt;P&gt;LOOP AT gt_bsik INTO wa_bsik.&lt;/P&gt;&lt;P&gt;w_sum = w_sum + wa_bsik-buzei.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AT END OF lifnr.&lt;/P&gt;&lt;P&gt;                  APPEND lt_vendors.&lt;/P&gt;&lt;P&gt;          APPEND gt_bsik_copy.&lt;/P&gt;&lt;P&gt;        ENDAT.&lt;/P&gt;&lt;P&gt;IF w_sum &amp;gt; 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DELETE gt_bsik WHERE lifnr =&lt;/P&gt;&lt;P&gt;gt_bsik_copy-lifnr  .&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above mentioned code when 1st vendor comes its checking for the 1st docu numbe line items alone.Its not checking for 2 nd docu num.I have&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2009 05:45:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-03T05:45:22Z</dc:date>
    <item>
      <title>Logic using at new stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070517#M1178044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  In my scenario have to write a code with the following logic.&lt;/P&gt;&lt;P&gt;consider in the internal table have the values of vendor,docu num ,buzei and amt.&lt;/P&gt;&lt;P&gt;my logic is if the 1st vendor comes in the loop have to count the line items and check for some codn next thing is check for 2nd vendor.Have written the coding as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT gt_bsik.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      wa_bsik = gt_bsik.&lt;/P&gt;&lt;P&gt;      AT NEW  lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_sum = 0.&lt;/P&gt;&lt;P&gt;LOOP AT gt_bsik INTO wa_bsik.&lt;/P&gt;&lt;P&gt;w_sum = w_sum + wa_bsik-buzei.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AT END OF lifnr.&lt;/P&gt;&lt;P&gt;                  APPEND lt_vendors.&lt;/P&gt;&lt;P&gt;          APPEND gt_bsik_copy.&lt;/P&gt;&lt;P&gt;        ENDAT.&lt;/P&gt;&lt;P&gt;IF w_sum &amp;gt; 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DELETE gt_bsik WHERE lifnr =&lt;/P&gt;&lt;P&gt;gt_bsik_copy-lifnr  .&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above mentioned code when 1st vendor comes its checking for the 1st docu numbe line items alone.Its not checking for 2 nd docu num.I have&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 05:45:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070517#M1178044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T05:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Logic using at new stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070518#M1178045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use clear statement in loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 05:48:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070518#M1178045</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2009-02-03T05:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Logic using at new stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070519#M1178046</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 my understanding u can achieve ur requirements like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
gt_bsik1[] = gt_bsik.

Loop at gt_bsik into wa_bsik.

Loop at gt_bsik1 into wa_bsik1 where lifnr = wa_bsik-lifnr.

"do  ur codings as per ur requirement

Endloop.
Endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 05:56:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070519#M1178046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T05:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Logic using at new stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070520#M1178047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Saranya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to change the logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT gt_bsik.
wa_bsik = gt_bsik.
AT NEW lifnr.

w_sum = 0.
* LOOP AT gt_bsik INTO wa_bsik.
* w_sum = w_sum + wa_bsik-buzei.
ENDAT.

w_sum = w_sum + gt_bsik-buzei.

AT END OF lifnr.
APPEND lt_vendors.
APPEND gt_bsik_copy.
ENDAT.

IF w_sum &amp;gt; 200.
DELETE gt_bsik WHERE lifnr =
gt_bsik_copy-lifnr .
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 05:58:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-using-at-new-stmt/m-p/5070520#M1178047</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-02-03T05:58:57Z</dc:date>
    </item>
  </channel>
</rss>

