<?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: Filtering the data in internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198510#M1375693</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;try using the syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DELETE ADJACENT DUPLICATES FROM (internal table) COMPARING ( field1, field2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2009 12:11:49 GMT</pubDate>
    <dc:creator>nikhil_chitre</dc:creator>
    <dc:date>2009-09-29T12:11:49Z</dc:date>
    <item>
      <title>Filtering the data in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198507#M1375690</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;I facing one problem. The issue is that i have to filter the data in an internal table. The sample is as shown:&lt;/P&gt;&lt;P&gt;AUFNR	MATNR	SER_NAME&lt;/P&gt;&lt;P&gt;sv1	mat1	ser_name1&lt;/P&gt;&lt;P&gt;sv1	mat2	ser_name2&lt;/P&gt;&lt;P&gt;sv1	mat3	ser_name3&lt;/P&gt;&lt;P&gt;sv2	mat21	ser_name21  &lt;/P&gt;&lt;P&gt;sv2	mat21	ser_name22&lt;/P&gt;&lt;P&gt;sv2	mat22	ser_name23&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As depited, the record, SV2 has the same matnr( mat21 ). The result should be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUFNR	MATNR	SER_NAME&lt;/P&gt;&lt;P&gt;sv1	mat1	ser_name1&lt;/P&gt;&lt;P&gt;sv1	mat2	ser_name2&lt;/P&gt;&lt;P&gt;sv1	mat3	ser_name3&lt;/P&gt;&lt;P&gt;sv2	mat21	ser_name21, ser_name22&lt;/P&gt;&lt;P&gt;sv2	mat22	ser_name23&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ser_name for 'mat21' should be concatenated and the other record should be deleted or I can prepare another table&lt;/P&gt;&lt;P&gt;for storing the result set(this i want to avoid .. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the scenario is not clear kindly let me know...:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s.a.k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 11:45:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198507#M1375690</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T11:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering the data in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198508#M1375691</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 the processing within the same internal table itself. Try like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: v_ind type i.
data: wa like itab.

loop at itab.
v_ind = sy-tabix + 1.
read table itab into wa index v_ind.
if itab-matnr = wa-matnr.
delete itab where aufnr = wa-aufnr matnr = wa-matnr ser_name = wa-ser_name.
concatenate itab-ser_name wa-ser_name into itab-ser_name.
modify itab.
clear wa.
endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vikranth.Reddy on Sep 29, 2009 5:33 PM Edited the read statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:00:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198508#M1375691</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T12:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering the data in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198509#M1375692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first sort the itab properly by sernr and material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab into is1.
 index = sy-index + 1.
 at last. " this is needed to remove the dump at the last line read
  exit.
 endat. 
 read table itab into is2 index index.
 if sy-subrc = 0.
   if is1-matnr = is2-matnr and is1-sernr = is2 sernr.
     concatenate is1-sur_name is2-sur_name into is1-surname,
   endif.
   modify itab from is1.
   delete itab index index.
 endif
 endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:08:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198509#M1375692</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T12:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering the data in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198510#M1375693</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;try using the syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DELETE ADJACENT DUPLICATES FROM (internal table) COMPARING ( field1, field2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 12:11:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198510#M1375693</guid>
      <dc:creator>nikhil_chitre</dc:creator>
      <dc:date>2009-09-29T12:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering the data in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198511#M1375694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikranth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much..:) it was really helpful..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also thanks to my other friends as well...:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s.a.k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 14:18:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filtering-the-data-in-internal-table/m-p/6198511#M1375694</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T14:18:02Z</dc:date>
    </item>
  </channel>
</rss>

