<?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: Two function module outputs comparison in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640502#M1762883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tnak you very much for all answers, they were very helpful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jul 2013 07:23:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-07-17T07:23:06Z</dc:date>
    <item>
      <title>Two function module outputs comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640497#M1762878</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;My question is maybe simple, but I am working at SAP only few days, so any your help will be very welcome. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Situation&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;I have function module, that can match telephone number to operator. You fill gab with telephone number in parameters screen and your output is table, when you can see, that your number is under operator 202 (T-Mobile for example).&lt;/P&gt;&lt;P&gt;I have made a copy of this function module and made some changes in the script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now, I would like to compare these two modules in one report to see, if it works on the same way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My idea&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;1) Have parameters screen with range of telephone numbers. &lt;/P&gt;&lt;P&gt;2) Then, I would like to call module 1, generate output table A (I mean list of tel. numbers with operator codes)&lt;/P&gt;&lt;P&gt;3) Call module 2 and generate output table B&lt;/P&gt;&lt;P&gt;4) Compare these 2 outputs and generate final output table with differencies (if system will found any).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to do it? Do you have any link to similar example? I have tried to found, but didnt found similar. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you a lot in advance, &lt;BR /&gt;Dimitrij &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 10:47:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640497#M1762878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-16T10:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Two function module outputs comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640498#M1762879</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;Your logic sounds good. Loop at one internal table, read the other internal table based on some condition by pasing the values read in loop of first internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now compare the work areas.. if any differences are found, then write it to the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kartik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 10:55:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640498#M1762879</guid>
      <dc:creator>Kartik2</dc:creator>
      <dc:date>2013-07-16T10:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Two function module outputs comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640499#M1762880</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;thank you for your opinion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;BR /&gt;Dimitrij &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 13:00:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640499#M1762880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-16T13:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Two function module outputs comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640500#M1762881</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 compare two tables just like any other variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these are your output tables and work areas&lt;/P&gt;&lt;P&gt;itab1, wa_itab1 like line of itab&lt;/P&gt;&lt;P&gt;itab2, wa_itab2 like line of itab&lt;/P&gt;&lt;P&gt;itab_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* First sort both tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab1 by phoneno&lt;/P&gt;&lt;P&gt;sort itab2 by phoneno&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab1[] EQ itab2[].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'Results are same'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; loop at itab1 into wa_itab1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;READ TABLE itab2 INTO wa_itab2 WITH KEY phoneno = wa_itab1-phoneno'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;* Case 1 - Phone nos in itab1 not there in itab2&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if sy-subrc ne = 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; append wa_itab1 to itab_final.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* case 2 - Phone nos in both tables but with differnt operators.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elseif wa_itab1 ne waItab2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; append wa_itab1 to itab_final.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; append wa_itab2 to itab_final.&lt;/SPAN&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; endif.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; clear wa_itab1, wa_itab2,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;endloop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2 into wa_itab2.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;READ TABLE itab1 INTO wa_itab1 WITH KEY phoneno = wa_itab1-phoneno.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;*case 3 - phone nos in itab2 not in itab1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if sy-subrc ne = 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; append wa_itab2 to itab_final.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; clear : wa_itab1, wa_itab2.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;endloop.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; ''results are not same'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;Loop at itab_final into wa_final.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write:/ wa_final. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;endloop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;endif. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 13:20:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640500#M1762881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-16T13:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Two function module outputs comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640501#M1762882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dimitrij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your logic sounds good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step1-You may build two internal tables, A and B lets say&lt;/P&gt;&lt;P&gt;Step 2- loop and compare the two based on a primary key and build the diffrences table call it C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These tables can be of same type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use hash table to have unıque or you can have a normal standard table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort the internal table and do a binary search will give you fast access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at a &lt;/P&gt;&lt;P&gt;read table b with key x = a.x.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;append initial line to C&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 14:21:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640501#M1762882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-16T14:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Two function module outputs comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640502#M1762883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tnak you very much for all answers, they were very helpful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 07:23:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640502#M1762883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-17T07:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Two function module outputs comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640503#M1762884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have Hi Susmitha, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much for your afforts. Can you, please, explain, what do you mean by:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sy&lt;/STRONG&gt;&lt;SPAN style="color: #808080;"&gt;&lt;STRONG&gt;-subrc&lt;/STRONG&gt;, &lt;STRONG&gt;nos&lt;/STRONG&gt; and &lt;STRONG&gt;wa_itab1 &lt;/STRONG&gt;in Case 1? I have other names of tables, of course, but I didnt understand these your explanations in this step, and little bit lost with my code.&lt;BR /&gt;&lt;BR /&gt;Regards, &lt;BR /&gt;Dimitrij &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 08:06:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640503#M1762884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-17T08:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Two function module outputs comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640504#M1762885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Dimitrij,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can definitely use any name for your tables, I just used them for illustration, just to show you the logic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that code, itab1 is the output table for the first function module, replace it with the name you have used. &lt;/P&gt;&lt;P&gt;Itab2 is the output table for the second function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_itab1 and wa_itab2 are the workareas that are used for processing the tables itab1 and itab2 respectively. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phone Nos - I meant Phone numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1[] = itab2[] checks if both the tables are same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If they are not the same, it can be due to three situations. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Phone numbers&amp;nbsp; in first table, itab1 not in second table itab2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sy-subrc ne 0, means no matching record have been found. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Phone numbers that are there in both the tables but with different value for the operators.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Phone numbers that are there in second table itab2, not there in itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All these three cases have been taken care of in the program and the records with these unmatched phone number are appended to the final table itab_final. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 09:45:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-function-module-outputs-comparison/m-p/9640504#M1762885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-17T09:45:07Z</dc:date>
    </item>
  </channel>
</rss>

