<?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: Caomparing internal table entries in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982668#M1160949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jan 2009 20:27:29 GMT</pubDate>
    <dc:creator>former_member852986</dc:creator>
    <dc:date>2009-01-07T20:27:29Z</dc:date>
    <item>
      <title>Caomparing internal table entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982664#M1160945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having some contents in the internal table like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

155555666
155555667
155555666abcd
155555667bcdf &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to compare only first 9 characters of the entries and delete the duplicate entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one suggest me how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 00:55:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982664#M1160945</guid>
      <dc:creator>former_member852986</dc:creator>
      <dc:date>2009-01-07T00:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Caomparing internal table entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982665#M1160946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort itab by fld1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa_itab-fld1+0(9) = w_var.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_itab2 = wa_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_itab2 to itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_var = wa_itab-fld1+0(9).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now itab2 has all the duplicate entries which you can delete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. - you might need to modify the code a bit as I didnt tested it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 01:06:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982665#M1160946</guid>
      <dc:creator>amit_khare</dc:creator>
      <dc:date>2009-01-07T01:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Caomparing internal table entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982666#M1160947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Arun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is another approach which you might like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_ITAB_DUPL_RECORDS
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Thread: Caomparing internal table entries
*&amp;amp; &amp;lt;a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1188520"&amp;gt;&amp;lt;/a&amp;gt;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_itab_dupl_records.


TYPES: BEGIN OF ty_s_itab.
TYPES: val(20)  TYPE c.
TYPES: END OF ty_s_itab.

DATA: gt_itab    TYPE STANDARD TABLE OF ty_s_itab
                 WITH DEFAULT KEY,
      gs_rec     TYPE ty_s_itab,
      gd_idx     TYPE i.

START-OF-SELECTION.

  gs_rec-val = '155555666'.     APPEND gs_rec TO gt_itab.
  gs_rec-val = '155555667'.     APPEND gs_rec TO gt_itab.
  gs_rec-val = '155555666abcd'. APPEND gs_rec TO gt_itab.
  gs_rec-val = '155555667efgh'. APPEND gs_rec TO gt_itab.


  SORT gt_itab BY val.

  LOOP AT gt_itab INTO gs_rec.
    WRITE: / gs_rec-val.
  ENDLOOP.

  LOOP AT gt_itab INTO gs_rec.
    gd_idx = syst-tabix + 1.

    LOOP AT gt_itab TRANSPORTING NO FIELDS FROM gd_idx
            WHERE ( val+0(9) = gs_rec-val+0(9) ).
      DELETE gt_itab INDEX syst-tabix.
    ENDLOOP.

  ENDLOOP.

  skip.
  LOOP AT gt_itab INTO gs_rec.
    WRITE: / gs_rec-val.
  ENDLOOP.

END-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 04:40:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982666#M1160947</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-01-07T04:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Caomparing internal table entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982667#M1160948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;You can use the following code, as it will print the first occurence of the new value in itab of length 9 and delete the remaining.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from itab comparing a+0(9).&lt;/P&gt;&lt;P&gt;Here itab is the internal table and a is the field in that internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope this solves your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin Dargan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 05:41:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982667#M1160948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T05:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Caomparing internal table entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982668#M1160949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 20:27:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caomparing-internal-table-entries/m-p/4982668#M1160949</guid>
      <dc:creator>former_member852986</dc:creator>
      <dc:date>2009-01-07T20:27:29Z</dc:date>
    </item>
  </channel>
</rss>

