<?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 generic tables. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-generic-tables/m-p/6572198#M1432995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to build a generic table comparison.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The general idea was to loop through one and read the other.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT i_table1 ASSIGNING &amp;lt;line1&amp;gt;.
    READ TABLE i_table2 ASSIGNING &amp;lt;line2&amp;gt; INDEX sy-tabix.
      idx_field = 1.
      DO.
        UNASSIGN &amp;lt;field1&amp;gt;.
        UNASSIGN &amp;lt;field2&amp;gt;.
        ASSIGN COMPONENT idx_field OF STRUCTURE &amp;lt;line1&amp;gt; TO &amp;lt;field1&amp;gt;.
        ASSIGN COMPONENT idx_field OF STRUCTURE &amp;lt;line2&amp;gt; TO &amp;lt;field2&amp;gt;.
        IF &amp;lt;field1&amp;gt; IS ASSIGNED AND &amp;lt;field2&amp;gt; IS ASSIGNED.
          IF &amp;lt;field1&amp;gt; = &amp;lt;field2&amp;gt;.
         .....
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in order to make it generic the method parameter has to be of type ANY TABLE.&lt;/P&gt;&lt;P&gt;then i'm nit able to read the table by index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a solution to compare to generic tables ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Rasmus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Feb 2010 14:34:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-02T14:34:31Z</dc:date>
    <item>
      <title>Compare generic tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-generic-tables/m-p/6572198#M1432995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to build a generic table comparison.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The general idea was to loop through one and read the other.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT i_table1 ASSIGNING &amp;lt;line1&amp;gt;.
    READ TABLE i_table2 ASSIGNING &amp;lt;line2&amp;gt; INDEX sy-tabix.
      idx_field = 1.
      DO.
        UNASSIGN &amp;lt;field1&amp;gt;.
        UNASSIGN &amp;lt;field2&amp;gt;.
        ASSIGN COMPONENT idx_field OF STRUCTURE &amp;lt;line1&amp;gt; TO &amp;lt;field1&amp;gt;.
        ASSIGN COMPONENT idx_field OF STRUCTURE &amp;lt;line2&amp;gt; TO &amp;lt;field2&amp;gt;.
        IF &amp;lt;field1&amp;gt; IS ASSIGNED AND &amp;lt;field2&amp;gt; IS ASSIGNED.
          IF &amp;lt;field1&amp;gt; = &amp;lt;field2&amp;gt;.
         .....
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in order to make it generic the method parameter has to be of type ANY TABLE.&lt;/P&gt;&lt;P&gt;then i'm nit able to read the table by index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a solution to compare to generic tables ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Rasmus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2010 14:34:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-generic-tables/m-p/6572198#M1432995</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-02T14:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Compare generic tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-generic-tables/m-p/6572199#M1432996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can compare two tables like the next example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if table1[] = table2[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write 'ok'.&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;write 'bad'.&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;Table1 and table2 can be field symbols&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2010 18:34:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-generic-tables/m-p/6572199#M1432996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-02T18:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Compare generic tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-generic-tables/m-p/6572200#M1432997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately there can be some minor differences due to some naming conventions.&lt;/P&gt;&lt;P&gt;So I have to check each field in order to determine if the difference is caused by these naming conventions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Rasmus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2010 06:37:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-generic-tables/m-p/6572200#M1432997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-03T06:37:08Z</dc:date>
    </item>
  </channel>
</rss>

