<?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 Compare two Hash Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/7722620#M1580268</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I want to compare two hash table. here is the sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF company,
"name(20) TYPE c,
uom  TYPE char4,
qty TYPE i,
END OF company.

DATA: comp TYPE company,
comptab TYPE HASHED TABLE OF company
WITH UNIQUE KEY uom,
comptab1 TYPE HASHED TABLE OF company
WITH UNIQUE KEY uom.
comp-uom = 'KG'.comp-qty = 10. COLLECT comp INTO comptab.
comp-uom = 'CT'.comp-qty = 20. COLLECT comp INTO comptab.
comp-uom = 'KG'.comp-qty = 30. COLLECT comp INTO comptab.
comp-uom = 'CT'.comp-qty = 10. COLLECT comp INTO comptab1.
comp-uom = 'KG'.comp-qty = 20. COLLECT comp INTO comptab1.
comp-uom = 'CT'.comp-qty = 10. COLLECT comp INTO comptab1.
comp-uom = 'KG'.comp-qty = 20. COLLECT comp INTO comptab1.

LOOP AT comptab INTO comp.
  WRITE : comp-uom, comp-qty .
  NEW-LINE.
ENDLOOP.

NEW-LINE.
WRITE : 'Second Table'.
NEW-LINE.
LOOP AT comptab1 INTO comp.
  WRITE : comp-uom, comp-qty .
  NEW-LINE.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I have two table comptab and comptab1. I want to compare these two table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kapil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Mar 2011 10:26:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-03-29T10:26:28Z</dc:date>
    <item>
      <title>Compare two Hash Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/7722620#M1580268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I want to compare two hash table. here is the sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF company,
"name(20) TYPE c,
uom  TYPE char4,
qty TYPE i,
END OF company.

DATA: comp TYPE company,
comptab TYPE HASHED TABLE OF company
WITH UNIQUE KEY uom,
comptab1 TYPE HASHED TABLE OF company
WITH UNIQUE KEY uom.
comp-uom = 'KG'.comp-qty = 10. COLLECT comp INTO comptab.
comp-uom = 'CT'.comp-qty = 20. COLLECT comp INTO comptab.
comp-uom = 'KG'.comp-qty = 30. COLLECT comp INTO comptab.
comp-uom = 'CT'.comp-qty = 10. COLLECT comp INTO comptab1.
comp-uom = 'KG'.comp-qty = 20. COLLECT comp INTO comptab1.
comp-uom = 'CT'.comp-qty = 10. COLLECT comp INTO comptab1.
comp-uom = 'KG'.comp-qty = 20. COLLECT comp INTO comptab1.

LOOP AT comptab INTO comp.
  WRITE : comp-uom, comp-qty .
  NEW-LINE.
ENDLOOP.

NEW-LINE.
WRITE : 'Second Table'.
NEW-LINE.
LOOP AT comptab1 INTO comp.
  WRITE : comp-uom, comp-qty .
  NEW-LINE.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I have two table comptab and comptab1. I want to compare these two table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kapil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 10:26:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/7722620#M1580268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-29T10:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two Hash Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/7722621#M1580269</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;You may want to have a look at the Wiki posting:&lt;/P&gt;&lt;P&gt;[Comparing Two Internal Tables - A Generic Approach|http://wiki.sdn.sap.com/wiki/display/Snippets/Comparing&lt;EM&gt;Two&lt;/EM&gt;Internal&lt;EM&gt;Tables&lt;/EM&gt;-&lt;EM&gt;A&lt;/EM&gt;Generic+Approach]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 11:40:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/7722621#M1580269</guid>
      <dc:creator>ravi_lanjewar</dc:creator>
      <dc:date>2011-03-29T11:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two Hash Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/7722622#M1580270</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;Do it like this. However this is not a normal use of hashed tables and I think it will have impact on performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT: comptab, comptab1.
IF comptab1[] = comptab[].
  WRITE 'equal'.
ELSE.
  WRITE 'not equal'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Marcin Cholewczuk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 21:07:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/7722622#M1580270</guid>
      <dc:creator>marcin_cholewczuk</dc:creator>
      <dc:date>2011-03-29T21:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two Hash Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/14079715#M2041645</link>
      <description>&lt;P&gt;I think this gives wrong answer since there is no indexing in hashed tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 07:24:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-two-hash-table/m-p/14079715#M2041645</guid>
      <dc:creator>Isha597</dc:creator>
      <dc:date>2025-04-18T07:24:53Z</dc:date>
    </item>
  </channel>
</rss>

