<?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 Testing and comparing internal table content in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497739#M1746858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm coding a report which&lt;/P&gt;&lt;P&gt;1) get data from DB&lt;/P&gt;&lt;P&gt;2) process them&lt;/P&gt;&lt;P&gt;3) append to internal table &lt;/P&gt;&lt;P&gt;4) save as a local file from that internal table.&lt;/P&gt;&lt;P&gt;Is it possible to create a test (unit test or something) where I run my report and after execution compare current data with data before last program changes.&lt;/P&gt;&lt;P&gt;My problem is that internal table structure is big and comapred results should have a few lines so I don't want to create data to compare manualy.&lt;/P&gt;&lt;P&gt;I would like somehow to save my current data and use it for future tests.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 02 Jun 2013 19:52:51 GMT</pubDate>
    <dc:creator>kzak</dc:creator>
    <dc:date>2013-06-02T19:52:51Z</dc:date>
    <item>
      <title>Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497739#M1746858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm coding a report which&lt;/P&gt;&lt;P&gt;1) get data from DB&lt;/P&gt;&lt;P&gt;2) process them&lt;/P&gt;&lt;P&gt;3) append to internal table &lt;/P&gt;&lt;P&gt;4) save as a local file from that internal table.&lt;/P&gt;&lt;P&gt;Is it possible to create a test (unit test or something) where I run my report and after execution compare current data with data before last program changes.&lt;/P&gt;&lt;P&gt;My problem is that internal table structure is big and comapred results should have a few lines so I don't want to create data to compare manualy.&lt;/P&gt;&lt;P&gt;I would like somehow to save my current data and use it for future tests.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jun 2013 19:52:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497739#M1746858</guid>
      <dc:creator>kzak</dc:creator>
      <dc:date>2013-06-02T19:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497740#M1746859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Krzysztof,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1, Try to download the before internal table to local named with 1.xls ( Microsoft Excel format ).&lt;/P&gt;&lt;P&gt;2, Download the second internal table to local named with 2.xls ( Microsoft Excel format ). &lt;/P&gt;&lt;P&gt;3, Use the excel funcion "IF".&amp;nbsp;&amp;nbsp; =if(a1=b1,"","NOT THE SAME").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the description of 'IF' function.&lt;/P&gt;&lt;P&gt;The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that condition evaluates to FALSE. For example, the formula =IF(A1&amp;gt;10,"Over 10","10 or less") returns "Over 10" if A1 is greater than 10, and "10 or less" if A1 is less than or equal to 10.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 01:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497740#M1746859</guid>
      <dc:creator>former_member192023</dc:creator>
      <dc:date>2013-06-03T01:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497741#M1746860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zak,&lt;/P&gt;&lt;P&gt;Could you be more specific, do you want to compare data of two internal tables. And if you want to compare what you want to compare whether records are same or not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Satish Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 04:58:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497741#M1746860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-03T04:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497742#M1746861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Krzysztof,&lt;/P&gt;&lt;P&gt;use the debugger to see the variations in internal table variable values.&lt;/P&gt;&lt;P&gt;and to save the values just copy paste them onto an excel sheet &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1495/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jay Kamdar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 05:11:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497742#M1746861</guid>
      <dc:creator>Jay_Kamdar</dc:creator>
      <dc:date>2013-06-03T05:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497743#M1746862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Zak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case i would suggest you two solutions:&lt;/P&gt;&lt;P&gt;1) You can create a custom table ZDUMP, and along with taking a presentation file dump, save this data into ZDUMP table. With each run, pull the data from ZDUMP and compare with the current data in the program itself and create a difference report. After processing the report, i mean at last, delete the data from ZDUMP and insert your last run result. This way you can have your last run data always available to compare from ZDUMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Second, not a very good option is to pull the file on the presentation server. Create a new program or a button funtionality to pull data from presentation server and then compare and generate the difference report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would still prefer having the last run data in ZDUMP and pulling from DB rather than presentation server but based on your req you may opt for second option as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for comparision check the FMs: 'COMPARE_TABLES'&lt;/P&gt;&lt;P&gt;CULI_L_SET_DIFFERENCE&lt;/P&gt;&lt;P&gt;CTVB_COMPARE_TABLES&lt;/P&gt;&lt;P&gt;CTVB_COMPARE_TABLES_2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Revert if still in doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;DN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 05:20:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497743#M1746862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-03T05:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497744#M1746863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i understood you , then you need to export the internal table values to local file, follow the screenshot for the same -&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/225595" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Then you can compare the values in Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ankit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 05:37:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497744#M1746863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-03T05:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497745#M1746864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Zak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would rather prefer the below steps - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Program #1 generates the list of data which u would need to compare it in next subsequent execution of the same program.&lt;/P&gt;&lt;P&gt;2. Export the List (Or here just say an internal table) in a ABAP memory with DATABASE option. &lt;/P&gt;&lt;P&gt;(Follow F4 for EXPORT/IMPORT using DATABASE). ##### Here you would need to mind the limitations and importance/performance about Database option. As database export will be permanant. &lt;/P&gt;&lt;P&gt;3. Execute Program #1 again and pull out earlier EXPORTED data in to another internal table. &lt;/P&gt;&lt;P&gt;4. Compare the two internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope will give another direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Ravi Sonar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 05:44:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497745#M1746864</guid>
      <dc:creator>former_member214878</dc:creator>
      <dc:date>2013-06-03T05:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497746#M1746865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put a break point at the place where you have written the FM or code to send data into local file.&lt;/P&gt;&lt;P&gt;Now inside debugging click on the table name, and choose first line of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right click --&amp;gt; save to local file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give the path and save the file as 'Spread sheet', means in excel format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way you can compare file data for different runs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 05:47:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497746#M1746865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-03T05:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Testing and comparing internal table content</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497747#M1746866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krzysztof,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could create a hash out of the internal table content (for example with function CALCULATE_HASH_FOR_CHAR), and then only compare the Hash-values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards, Randolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 10:33:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-and-comparing-internal-table-content/m-p/9497747#M1746866</guid>
      <dc:creator>former_member184455</dc:creator>
      <dc:date>2013-06-03T10:33:01Z</dc:date>
    </item>
  </channel>
</rss>

