<?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 Intranl table loop logic... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/intranl-table-loop-logic/m-p/6082119#M1357096</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;I have a internal table filles with data from a custom table. There are two key fields and one non-key field in custom table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am looping on the internal table. I want certain logic to get executed even if first key or second key field is&lt;/P&gt;&lt;P&gt;different from respective previous first and second key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using following logic but it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by k1 k2.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab.
at new k1.
at new k2.
perform logic.
endat.
endat.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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;Regards,&lt;/P&gt;&lt;P&gt;Jainam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:17 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:18 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:18 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:19 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:19 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:20 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Sep 2009 19:17:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-14T19:17:28Z</dc:date>
    <item>
      <title>Intranl table loop logic...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/intranl-table-loop-logic/m-p/6082119#M1357096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;I have a internal table filles with data from a custom table. There are two key fields and one non-key field in custom table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am looping on the internal table. I want certain logic to get executed even if first key or second key field is&lt;/P&gt;&lt;P&gt;different from respective previous first and second key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using following logic but it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by k1 k2.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab.
at new k1.
at new k2.
perform logic.
endat.
endat.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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;Regards,&lt;/P&gt;&lt;P&gt;Jainam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:17 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:18 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:18 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:19 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:19 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jainam Shah on Sep 14, 2009 9:20 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 19:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/intranl-table-loop-logic/m-p/6082119#M1357096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T19:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Intranl table loop logic...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/intranl-table-loop-logic/m-p/6082120#M1357097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Shah&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do the following way,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
" K1 must be the First Field in the Internal Table and K2 Must be 2nd
Loop at itab.
at new k1.
" perform logic for K1
endat.
at new k2.
" perform logic for K2
endat.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope will help you to solve out your problem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 19:45:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/intranl-table-loop-logic/m-p/6082120#M1357097</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-09-14T19:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Intranl table loop logic...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/intranl-table-loop-logic/m-p/6082121#M1357098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you chose AT NEW k2, there is a breakdown  when k1 or k2 changes.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab.
at new k2.
 perform logic.
endat.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 19:45:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/intranl-table-loop-logic/m-p/6082121#M1357098</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-09-14T19:45:58Z</dc:date>
    </item>
  </channel>
</rss>

