<?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 Loop at Conditions within internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598728#M1276031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not been ABAPing long so primarily have been using keyword help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to loop round an itab and only select and process unique keys from within the table!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the table I am using to obtain the records has multiple records with the same reference and I am only interested in each unique occurrence of the IBASE_COMPONENT_GUID field.&lt;/P&gt;&lt;P&gt;So there could be four items for one Appliance and four for another one. So of the eight records, I would only need to loop round and select the unique GUIDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there would only be two unique appliances I need to extract the records for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I am trying to do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    LOOP AT GT_ITEM_DATA INTO GS_ITEM_DATA WITH UNIQUE KEY IBASE_COMPONENT_GUID. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to select each unique occurrence?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 May 2009 21:19:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-05T21:19:24Z</dc:date>
    <item>
      <title>Loop at Conditions within internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598728#M1276031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not been ABAPing long so primarily have been using keyword help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to loop round an itab and only select and process unique keys from within the table!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the table I am using to obtain the records has multiple records with the same reference and I am only interested in each unique occurrence of the IBASE_COMPONENT_GUID field.&lt;/P&gt;&lt;P&gt;So there could be four items for one Appliance and four for another one. So of the eight records, I would only need to loop round and select the unique GUIDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there would only be two unique appliances I need to extract the records for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I am trying to do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    LOOP AT GT_ITEM_DATA INTO GS_ITEM_DATA WITH UNIQUE KEY IBASE_COMPONENT_GUID. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to select each unique occurrence?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 21:19:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598728#M1276031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T21:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Conditions within internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598729#M1276032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically, I use the COLLECT statement when I need to get the unique field (character only) field from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a table with only one field, GUID.&lt;/P&gt;&lt;P&gt;LOOP through your main table, assign its GUID to new table's field GUID&lt;/P&gt;&lt;P&gt;Use COLLECT new_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other option is, &lt;/P&gt;&lt;P&gt;Sort the table by GUID&lt;/P&gt;&lt;P&gt;Loop through it and use AT NEW GUID or AT END OF GUID &lt;/P&gt;&lt;P&gt;Fill out the table with this GUID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 21:24:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598729#M1276032</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-05-05T21:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Conditions within internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598730#M1276033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Other option is, &lt;/P&gt;&lt;P&gt;&amp;gt; Sort the table by GUID&lt;/P&gt;&lt;P&gt;&amp;gt; Loop through it and use AT NEW GUID or AT END OF GUID &lt;/P&gt;&lt;P&gt;&amp;gt; Fill out the table with this GUID.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Bear in mind that GUID has to be the first field of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 21:27:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598730#M1276033</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T21:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Loop at Conditions within internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598731#M1276034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i went for the option DELETE ADJACENT DUPLICATES before hitting the loop and that does the trick!  :o]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 11:35:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-conditions-within-internal-table/m-p/5598731#M1276034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-15T11:35:08Z</dc:date>
    </item>
  </channel>
</rss>

