<?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: compairing two itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612088#M599264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all,&lt;/P&gt;&lt;P&gt;my problem has been solved.&lt;/P&gt;&lt;P&gt;Point has been given.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2007 12:39:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-24T12:39:06Z</dc:date>
    <item>
      <title>compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612074#M599250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt; I have two internal table with same structure but different records.&lt;/P&gt;&lt;P&gt; i want to set a flag if  records are different of internal table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data : itab1 like mara occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data : itab2 like itab occurs 0 with header line.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;itab2[] = itab1[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now suppose i make changes in itab1 .&lt;/P&gt;&lt;P&gt;same structure but different records... what will be answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********Point is assured.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:08:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612074#M599250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612075#M599251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;If the data is same u can use&lt;/P&gt;&lt;P&gt;itab1[] = itab2[].&lt;/P&gt;&lt;P&gt;If it is different then u can use MOVE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:10:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612075#M599251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612076#M599252</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;if not itab1[]  =  itab2[].&lt;/P&gt;&lt;P&gt; do something&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;&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Srikanta Gope&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:10:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612076#M599252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612077#M599253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
IF itab2[] NE itab1[].
  "Records are different
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or am I looking at it too simply? &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:10:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612077#M599253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612078#M599254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;U can compare 2 internal tabs &lt;/P&gt;&lt;P&gt;usining&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If itab1[] = itab2[].&lt;/P&gt;&lt;P&gt;message...&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:11:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612078#M599254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612079#M599255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;firstyl if u use itab2[] = itab1[] then u are assigning all the values of one internal  tabe to another. &lt;/P&gt;&lt;P&gt;both will contain the same records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can loop one internal table and corresponding read the other internal table using read statement with key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;read table itab2 with &amp;lt;key&amp;gt; = itab-&amp;lt;key&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;ur code&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points plz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:12:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612079#M599255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612080#M599256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;      If u want to compare all fields,&lt;/P&gt;&lt;P&gt;for matching purpose,&lt;/P&gt;&lt;P&gt;then we can do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : a like t001 occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data : b like t001 occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF A = B.&lt;/P&gt;&lt;P&gt;WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'SAME'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:13:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612080#M599256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612081#M599257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow - You've gotta love SDN! 4 answers within 3 minutes of the question being asked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:14:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612081#M599257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612082#M599258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope this will help u..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comparing Internal Tables  &lt;/P&gt;&lt;P&gt;Like other data objects, you can use internal tables as operands in logical expressions.&lt;/P&gt;&lt;P&gt;.... &amp;lt;itab1&amp;gt; &amp;lt;operator&amp;gt; &amp;lt;itab2&amp;gt; ...&lt;/P&gt;&lt;P&gt;For &amp;lt;operator&amp;gt;, all operators listed in the table in Comparisons Between Data Types can be used (EQ, =, NE, &amp;lt;&amp;gt;, &amp;gt;&amp;lt;, GE, &amp;gt;=, LE, &amp;lt;=, GT, &amp;gt;, LT, &amp;lt;). &lt;/P&gt;&lt;P&gt;If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets ([ ]) after the table name.&lt;/P&gt;&lt;P&gt;The first criterion for comparing internal tables is the number of lines they contain. The more lines an internal table contains, the larger it is. If two internal tables contain the same number of lines, they are compared line by line, component by component. If components of the table lines are themselves internal tables, they are compared recursively. If you are testing internal tables for anything other than equality, the comparison stops when it reaches the first pair of components that are unequal, and returns the corresponding result. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
DATA: ITAB LIKE TABLE OF LINE,
JTAB LIKE TABLE OF LINE.
DO 3 TIMES.
LINE-COL1 = SY-INDEX.
LINE-COL2 = SY-INDEX ** 2.
  APPEND LINE TO ITAB.
ENDDO.
MOVE ITAB TO JTAB.
LINE-COL1 = 10. LINE-COL2 = 20.
APPEND LINE TO ITAB.
IF ITAB GT JTAB.
WRITE / 'ITAB GT JTAB'.
ENDIF.
APPEND LINE TO JTAB.
IF ITAB EQ JTAB.
WRITE / 'ITAB EQ JTAB'.
ENDIF.
LINE-COL1 = 30. LINE-COL2 = 80.
APPEND LINE TO ITAB.
IF JTAB LE ITAB.
WRITE / 'JTAB LE ITAB'.
ENDIF.
LINE-COL1 = 50. LINE-COL2 = 60.
APPEND LINE TO JTAB.
IF ITAB NE JTAB.
WRITE / 'ITAB NE JTAB'.
ENDIF.
IF ITAB LT JTAB.
WRITE / 'ITAB LT JTAB'.
ENDIF.
The output is: 
ITAB GT JTAB
ITAB EQ JTAB
JTAB LE ITAB
ITAB NE JTAB
ITAB LT JTAB
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This example creates two standard tables, ITAB and JTAB. ITAB is filled with 3 lines and copied to JTAB. Then, another line is appended to ITAB and the first logical expression tests whether ITAB is greater than JTAB. After appending the same line to JTAB, the second logical expression tests whether both tables are equal. Then, another line is appended to ITAB and the third logical expressions tests whether JTAB is less than or equal to ITAB. Next, another line is appended to JTAB. Its contents are unequal to the contents of the last line of ITAB. The next logical expressions test whether ITAB is not equal to JTAB. The first table field whose contents are different in ITAB and JTAB is COL1 in the last line of the table: 30 in ITAB and 50 in JTAB. Therefore, in the last logical expression, ITAB is less than JTAB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful..&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:14:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612082#M599258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612083#M599259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;i didn't understand your question well but you can do the following:&lt;/P&gt;&lt;P&gt;1) modify  itab1 and make a read statement  with all key fields i itab2.&lt;/P&gt;&lt;P&gt;   if present then set flag .&lt;/P&gt;&lt;P&gt;2) modify itab1 .&lt;/P&gt;&lt;P&gt;   then use modify  itab2 where &amp;lt;b&amp;gt;key_field(s) = value(s) from itab1&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sooness&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612083#M599259</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-07-24T10:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612084#M599260</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;this may help u:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*handling duplicates in Internal table: &lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assume that 'itab' is the name of the internal table that holds the sample data that u've posted,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.copy itab to a temporary table itab_temp&lt;/P&gt;&lt;P&gt;itab_temp[] = itab[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. use the following logic.&lt;/P&gt;&lt;P&gt;loop at itab. &lt;/P&gt;&lt;P&gt;clear w_count.&lt;/P&gt;&lt;P&gt;loop at itab_temp where f2 = itab-f2. &lt;/P&gt;&lt;P&gt;w_count = w_count + 1.&lt;/P&gt;&lt;P&gt;delete itab_temp.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;if w_count &amp;gt; 2.&lt;/P&gt;&lt;P&gt;append itab to itab_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;3. now the internal table 'itab_final' contains all the required values.&lt;/P&gt;&lt;P&gt;This is my itab1 records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f1 f2&lt;/P&gt;&lt;P&gt;101 1001&lt;/P&gt;&lt;P&gt;102 1001&lt;/P&gt;&lt;P&gt;103 1003&lt;/P&gt;&lt;P&gt;104 1004&lt;/P&gt;&lt;P&gt;105 1004&lt;/P&gt;&lt;P&gt;106 1004&lt;/P&gt;&lt;P&gt;107 1005&lt;/P&gt;&lt;P&gt;108 1005&lt;/P&gt;&lt;P&gt;Now in any temp table the output should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f1 f2&lt;/P&gt;&lt;P&gt;101 1001&lt;/P&gt;&lt;P&gt;102 1001&lt;/P&gt;&lt;P&gt;104 1004&lt;/P&gt;&lt;P&gt;105 1004&lt;/P&gt;&lt;P&gt;106 1004&lt;/P&gt;&lt;P&gt;107 1005&lt;/P&gt;&lt;P&gt;108 1005&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:21:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612084#M599260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612085#M599261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All ,&lt;/P&gt;&lt;P&gt;Thanks for your valuable support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just i want to compair records of two internal table which having same structure .&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;itab1 itab2 both having 3 records but different data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1-name = 'AAA'.      itab2-name = 'BBB'&lt;/P&gt;&lt;P&gt;itab1-age= 34.              itab2-age = 35&lt;/P&gt;&lt;P&gt;itab1-salary = $1200.    itab2-salary = $1400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to compair  ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 10:26:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612085#M599261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T10:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612086#M599262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,  &lt;/P&gt;&lt;P&gt;i think that you  will have to do that in a loop like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:BEGIN OF itab1 OCCURS 10,&lt;/P&gt;&lt;P&gt;     bukrs LIKE bkpf-bukrs,&lt;/P&gt;&lt;P&gt;     belnr like bkpf-belnr,&lt;/P&gt;&lt;P&gt;  gjahr like bkpf-gjahr,&lt;/P&gt;&lt;P&gt;     end of itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:BEGIN OF itab2 OCCURS 10,&lt;/P&gt;&lt;P&gt;     bukrs LIKE bkpf-bukrs,&lt;/P&gt;&lt;P&gt;     belnr like bkpf-belnr,&lt;/P&gt;&lt;P&gt;  gjahr like bkpf-gjahr,&lt;/P&gt;&lt;P&gt;     end of itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      data:wa_2 like itab2,&lt;/P&gt;&lt;P&gt;           v_count2 TYPE i,&lt;/P&gt;&lt;P&gt;           v_index TYPE i,&lt;/P&gt;&lt;P&gt;           wa_1 like itab1,&lt;/P&gt;&lt;P&gt;            v_count1 TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      move 'BE01' to wa_1-bukrs.&lt;/P&gt;&lt;P&gt;      move '01' to wa_1-belnr.&lt;/P&gt;&lt;P&gt;      move '2006' to wa_1-gjahr.&lt;/P&gt;&lt;P&gt;      append wa_1 to itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     move 'BE01' to wa_1-bukrs.&lt;/P&gt;&lt;P&gt;      move '02' to wa_1-belnr.&lt;/P&gt;&lt;P&gt;      move '2006' to wa_1-gjahr.&lt;/P&gt;&lt;P&gt;      append wa_1 to itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     move 'BE01' to wa_1-bukrs.&lt;/P&gt;&lt;P&gt;      move '03' to wa_1-belnr.&lt;/P&gt;&lt;P&gt;      move '2006' to wa_1-gjahr.&lt;/P&gt;&lt;P&gt;      append wa_1 to itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            move 'BE02' to wa_2-bukrs.&lt;/P&gt;&lt;P&gt;      move '01' to wa_2-belnr.&lt;/P&gt;&lt;P&gt;      move '2006' to wa_2-gjahr.&lt;/P&gt;&lt;P&gt;      append wa_2 to itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     move 'BE01' to wa_2-bukrs.&lt;/P&gt;&lt;P&gt;      move '02' to wa_2-belnr.&lt;/P&gt;&lt;P&gt;      move '2006' to wa_2-gjahr.&lt;/P&gt;&lt;P&gt;      append wa_2 to itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     move 'BE01' to wa_2-bukrs.&lt;/P&gt;&lt;P&gt;      move '03' to wa_2-belnr.&lt;/P&gt;&lt;P&gt;      move '2006' to wa_2-gjahr.&lt;/P&gt;&lt;P&gt;      append wa_2 to itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab1 by bukrs belnr gjahr.&lt;/P&gt;&lt;P&gt;sort itab2 by bukrs belnr gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE itab1 LINES v_count1.&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE itab2 LINES v_count2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if v_count1 = v_count2.&lt;/P&gt;&lt;P&gt;  loop at itab1 into wa_1.&lt;/P&gt;&lt;P&gt;    v_index = sy-tabix.&lt;/P&gt;&lt;P&gt;    read TABLE itab2 INTO wa_2 INDEX v_index.&lt;/P&gt;&lt;P&gt;    if wa_1 &amp;lt;&amp;gt; wa_2.&lt;/P&gt;&lt;P&gt;      write:'tables not similar!!'.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if v_index = v_count1.&lt;/P&gt;&lt;P&gt;      write:'tables similar!!'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;    write:'tables not similar!!'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sooness&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 11:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612086#M599262</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-07-24T11:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612087#M599263</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;U can use,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF itab1[] EQ itab2[].&lt;/P&gt;&lt;P&gt;WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; ''Two Tables are Similar'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Padmam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 11:06:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612087#M599263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T11:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: compairing two itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612088#M599264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all,&lt;/P&gt;&lt;P&gt;my problem has been solved.&lt;/P&gt;&lt;P&gt;Point has been given.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 12:39:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compairing-two-itab/m-p/2612088#M599264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T12:39:06Z</dc:date>
    </item>
  </channel>
</rss>

