<?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: looping loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103014#M981189</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;You can do in this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT zpdplh_itab into zpdplh_line.&lt;/P&gt;&lt;P&gt;READ TABLE zpdpld_itab into zpdld_line TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if zpdplh_line-bukrs eq zpdld_line-bukrs.&lt;/P&gt;&lt;P&gt;  if zpdplh_line-belnr ne zpdld_line-belnr.&lt;/P&gt;&lt;P&gt;    WRITE: /5 zpdplh_line-BUKRS&lt;/P&gt;&lt;P&gt;endif.&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>Tue, 08 Jul 2008 09:03:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-08T09:03:41Z</dc:date>
    <item>
      <title>looping loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103013#M981188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suppose I have this statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT zpdplh_itab into zpdplh_line.&lt;/P&gt;&lt;P&gt;    READ TABLE zpdpld_itab with KEY BUKRS = zpdplh_line-BUKRS BELNR = zpdplh_line-BELNR BUDAT = zpdplh_line-BUDAT TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;          WRITE: /5 zpdplh_line-BUKRS&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;Basically what it does is to output the fields that does not match between the two table. How do I loop if?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I want to compare to internal table&lt;/P&gt;&lt;P&gt;2) which I will then get two fields (let's say A and B) from both tables and compare them with each other&lt;/P&gt;&lt;P&gt;3) if they are the same then I will compare yet another two fields (C and D )to each other from both tables then I will output them if they are not the same (note. diff fields.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 08:53:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103013#M981188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T08:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: looping loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103014#M981189</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;You can do in this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT zpdplh_itab into zpdplh_line.&lt;/P&gt;&lt;P&gt;READ TABLE zpdpld_itab into zpdld_line TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if zpdplh_line-bukrs eq zpdld_line-bukrs.&lt;/P&gt;&lt;P&gt;  if zpdplh_line-belnr ne zpdld_line-belnr.&lt;/P&gt;&lt;P&gt;    WRITE: /5 zpdplh_line-BUKRS&lt;/P&gt;&lt;P&gt;endif.&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>Tue, 08 Jul 2008 09:03:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103014#M981189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T09:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: looping loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103015#M981190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi katrina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          When you use &lt;STRONG&gt;Loop at&lt;/STRONG&gt; and &lt;STRONG&gt;Read Table&lt;/STRONG&gt; stmt to compare two internal tables, there is no scope for finding multiple entries with the same value. I that case you can try the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************************************&lt;/P&gt;&lt;P&gt;Let itab1 have two fields A, C &amp;amp; itab2 have two fields B,D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;Loop at itab2 into wa2.&lt;/P&gt;&lt;P&gt;If wa1-A NE wa2-B.&lt;/P&gt;&lt;P&gt;write:/ wa1-A 'NE' wa2-B.&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;if wa1-C NE wa2-D.&lt;/P&gt;&lt;P&gt;write:/  wa1-C 'NE' wa2-D.&lt;/P&gt;&lt;P&gt;endif.&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;********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is helpful to you. If you need further information, revert back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all the helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nagaraj T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 09:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103015#M981190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T09:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: looping loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103016#M981191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this way,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE zpdpld_itab into WA COMPARING ALL FIELDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sujit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 09:11:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103016#M981191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T09:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: looping loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103017#M981192</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;suppose thier are two internal tables itab1 and itab2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read table itab2 with key &amp;lt;field&amp;gt; = itab1-&amp;lt;field&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;   if itab2-A EQ itab1-B.&lt;/P&gt;&lt;P&gt;      if itab2-C EQ itab1-D.&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        (output fields which you want if C &amp;amp; D are not same )&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;clear itab1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&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;SUDHIR MANJAREKAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: sudhir manjarekar on Jul 8, 2008 11:12 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 09:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103017#M981192</guid>
      <dc:creator>Sidh_M</dc:creator>
      <dc:date>2008-07-08T09:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: looping loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103018#M981193</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;well if the record is fetched from the internal table by READ statement then SY-SUBRC value will be equal to zero and if SY-SUBRC value is 0 then it is wrting the outptu to list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 09:14:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-loop/m-p/4103018#M981193</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2008-07-08T09:14:56Z</dc:date>
    </item>
  </channel>
</rss>

