<?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: About looping in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578641#M1080156</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Inside the first loop when these are satisfied then read the second table using the key vbeln into a workarea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Sep 2008 15:30:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-23T15:30:39Z</dc:date>
    <item>
      <title>About looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578640#M1080155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one internal table IT_MDEZ with certain fields and in second internal table i have some fields .&lt;/P&gt;&lt;P&gt; i have to read the IT_MDEZ where one field EXTRA lies in second internal table.&lt;/P&gt;&lt;P&gt;It is something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT it_mdez WHERE delkz = 'VC'&lt;/P&gt;&lt;P&gt;                          AND dat00 LT sy-datum&lt;/P&gt;&lt;P&gt;                          AND kunnr = it_temp1-kunnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                         AND extra(10) IN  ( it_cview-vbeln ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I need syntax for doing this 'AND extra(10) IN  ( it_cview-vbeln )'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extra(10) stores value of VBELN and have to run the loop no of times this value lies in the concerned internal table for each KUNNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Anshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 15:19:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578640#M1080155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-23T15:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: About looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578641#M1080156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Inside the first loop when these are satisfied then read the second table using the key vbeln into a workarea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 15:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578641#M1080156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-23T15:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: About looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578642#M1080157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to do a loop inside a loop to solve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_cview.&lt;/P&gt;&lt;P&gt;LOOP AT it_mdez WHERE delkz = 'VC'&lt;/P&gt;&lt;P&gt;AND dat00 LT sy-datum&lt;/P&gt;&lt;P&gt;AND kunnr = it_temp1-kunnr.&lt;/P&gt;&lt;P&gt;AND extra(10) =  it_cview-vbeln .&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;&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;Farzan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 16:53:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578642#M1080157</guid>
      <dc:creator>former_member137336</dc:creator>
      <dc:date>2008-09-23T16:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: About looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578643#M1080158</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 already tried this, but the problem is in my internal table i have more than one vbeln for a particular MATNR &amp;amp; KUNNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I do this, it takes first vbeln and put the data , then for second and so.....so they are repeating values....&lt;/P&gt;&lt;P&gt;My requirement is At new matnr.&lt;/P&gt;&lt;P&gt;For a particular KUNNR from first internal table and corresponding vbeln,  check all the vbeln in second internal table and sum the corresponding field MNG01 just once....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my first internal table:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row	WERKS	MATNR	VBELN	KUNNR	VKORG	KDGRP	MATKL&lt;/P&gt;&lt;P&gt;1	BP01	W48101	18	100003	BP01		W00010&lt;/P&gt;&lt;P&gt;2	BP01	W48101	1	C4101	BP01		W00010&lt;/P&gt;&lt;P&gt;3	BP01	W48101	13	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;4	BP01	W48101	12	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;5	BP01	W48101	11	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;6	BP01	W48101	10	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;7	BP01	W48101	9	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;8	BP01	W48101	8	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;9	BP01	W48101	7	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;10	BP01	W48101	6	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;11	BP01	W48101	2	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;12	BP01	W48101	3	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;13	BP01	W48101	4	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;14	BP01	W48101	5	C6100	BP01		W00010&lt;/P&gt;&lt;P&gt;15	BP01	W48101	19	C6113	BP01		W00010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output required is :-&lt;/P&gt;&lt;P&gt;W00010     W48101&lt;/P&gt;&lt;P&gt;                                  c6100  = sum of all mng01  from second internal table for corresponding vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I am clear..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anshuman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 17:08:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578643#M1080158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-23T17:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: About looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578644#M1080159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the structure of internal table as MATNR KUNNR VBELN .....&lt;/P&gt;&lt;P&gt;Then use the AT NEW VBELN statement in the first internal table loop. Inside that you loop on the second internal table and sum up the values of MNG01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Farzan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 17:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578644#M1080159</guid>
      <dc:creator>former_member137336</dc:creator>
      <dc:date>2008-09-23T17:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: About looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578645#M1080160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Anshu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does something like this help you meet your requirement?  Try using a loop and AT events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort i_tab1 by vbeln.&lt;/P&gt;&lt;P&gt;Loop at i_tab1 into wa_tab1.&lt;/P&gt;&lt;P&gt;Move wa_tab1 to l_tab1.&lt;/P&gt;&lt;P&gt;At new vbeln.&lt;/P&gt;&lt;P&gt;clear p_mng01.&lt;/P&gt;&lt;P&gt;loop at i_Tab2 into wa_tab2 where vbeln = l_tab1-vbeln.&lt;/P&gt;&lt;P&gt;p_mng01 = p_mng01 + wa_tab2-mng01.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;"Then move p_mng01 to wherever you need it&lt;/P&gt;&lt;P&gt;wa_tab2-totalmng = p_mng01.&lt;/P&gt;&lt;P&gt;Modify i_tab2  from wa_tab2 transporting totalmng&lt;/P&gt;&lt;P&gt;                                           where vbeln = l_tab1-vbeln&lt;/P&gt;&lt;P&gt;                                          and....... "whatever other key field(s) you may have in the table.&lt;/P&gt;&lt;P&gt;endat.&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;&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 17:32:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578645#M1080160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-23T17:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: About looping</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578646#M1080161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My problem solved. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2008 18:07:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-looping/m-p/4578646#M1080161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-23T18:07:24Z</dc:date>
    </item>
  </channel>
</rss>

