<?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: Comparing two internal tables: Problem appending diff table. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067098#M1354901</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;I can see in debug mode that everthing works just fine until APPEND.&lt;/P&gt;&lt;P&gt;I just want to add my structure into a table of type ANY or something...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check sy-subrc 0.&lt;/P&gt;&lt;P&gt;append &amp;lt;wa1&amp;gt; to &amp;lt;i_diff23&amp;gt; assigning &amp;lt;wa1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Aug 2009 05:08:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-25T05:08:26Z</dc:date>
    <item>
      <title>Comparing two internal tables: Problem appending diff table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067094#M1354897</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;I'm about to create a class with a simple method that should compare 2 internal tables and return the rows that differ from the MASTER table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the import tables are of type ANY. (table structure like MARA.)&lt;/P&gt;&lt;P&gt;Any pointers what I can do in order to get the append to work. It crashes with the error "You attempted to access an unassigned field symbol&lt;/P&gt;&lt;P&gt;(data segment 32775)."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method compare2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Local variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  field-symbols: &amp;lt;wa1&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                 &amp;lt;wa2&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                 &amp;lt;i_diff23&amp;gt; type standard table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  refresh: i_diff.&lt;/P&gt;&lt;P&gt;  loop at i_master assigning &amp;lt;wa1&amp;gt;.&lt;/P&gt;&lt;P&gt;    read table i_slave with key table_line = &amp;lt;wa1&amp;gt; transporting no fields.&lt;/P&gt;&lt;P&gt;    check sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    append &amp;lt;wa1&amp;gt; to &amp;lt;i_diff23&amp;gt; assigning &amp;lt;wa1&amp;gt;.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  i_diff = &amp;lt;i_diff23&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br, Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 21:27:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067094#M1354897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-24T21:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables: Problem appending diff table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067095#M1354898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The statement &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;loop at i_master assigning &amp;lt;wa1&amp;gt;.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; wiil lead toa dump because the field-symbol &amp;lt;WA1&amp;gt; has no defined structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do as follows:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a varaible of type data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : gv_obj TYPE REF TO DATA.

CREATE DATA gv_obj LIKE LINE OF i_master.

ASSIGN gv_obj-&amp;gt;* TO  &amp;lt;wa1&amp;gt;.

* NOW &amp;lt;WA1&amp;gt; HAS THE SAME STRUCTURE AS I_MASTER&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly you should define one more field symbol and assign the structure of i_slave to it.&lt;/P&gt;&lt;P&gt;and then read i_slave into that field -symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 21:45:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067095#M1354898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-24T21:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables: Problem appending diff table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067096#M1354899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that you two itabs have the &lt;STRONG&gt;same line structure&lt;/STRONG&gt; you may have a look at my Wiki posting&lt;/P&gt;&lt;P&gt;[Comparing Two Internal Tables - A Generic Approach|https://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;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 03:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067096#M1354899</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-08-25T03:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables: Problem appending diff table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067097#M1354900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Befor going for access of any field symbol you need to assign some reference either from data object or from variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In current case for every field symbol in code you can put IS ASSIGNED statement around it to avoid dumps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &amp;lt;wa&amp;gt; IS ASSIGNED.&lt;/P&gt;&lt;P&gt;   ........process..&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;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Augustin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 04:53:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067097#M1354900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-25T04:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables: Problem appending diff table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067098#M1354901</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;I can see in debug mode that everthing works just fine until APPEND.&lt;/P&gt;&lt;P&gt;I just want to add my structure into a table of type ANY or something...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check sy-subrc 0.&lt;/P&gt;&lt;P&gt;append &amp;lt;wa1&amp;gt; to &amp;lt;i_diff23&amp;gt; assigning &amp;lt;wa1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 05:08:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067098#M1354901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-25T05:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables: Problem appending diff table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067099#M1354902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 

DATA DIFF TYPE REF TO DATA.

CREATE DATA DIFF LIKE TABLE OF &amp;lt;wa1&amp;gt;.

ASSIGN DIFF-&amp;gt;* to &amp;lt;diff23&amp;gt;.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can remove  assigning &amp;lt;wa1&amp;gt; from your APPEND statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;wa1&amp;gt; and &amp;lt;diff23&amp;gt; are now having same strucutre.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, Make sure you use IS ASSIGNED before accessing any field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Augustin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 05:28:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067099#M1354902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-25T05:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables: Problem appending diff table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067100#M1354903</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;Change my code to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method compare2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Local variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  field-symbols: &amp;lt;wa1&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                 &amp;lt;wa2&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                 &amp;lt;i_diff23&amp;gt; type standard table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: l_sy_subrc type sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data diff type ref to data.&lt;/P&gt;&lt;P&gt;  create data diff like table of &amp;lt;wa1&amp;gt;.     &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; ERROR &amp;lt;WA1&amp;gt; not assign...&lt;/P&gt;&lt;P&gt;  assign diff-&amp;gt;* to &amp;lt;i_diff23&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  refresh: i_diff.&lt;/P&gt;&lt;P&gt;  loop at i_master assigning &amp;lt;wa1&amp;gt;.&lt;/P&gt;&lt;P&gt;    read table i_slave with key table_line = &amp;lt;wa1&amp;gt; transporting no fields.&lt;/P&gt;&lt;P&gt;    l_sy_subrc  =  sy-subrc.&lt;/P&gt;&lt;P&gt;    if l_sy_subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      if &amp;lt;wa1&amp;gt; is assigned.&lt;/P&gt;&lt;P&gt;        if &amp;lt;i_diff23&amp;gt; is assigned.&lt;/P&gt;&lt;P&gt;          append &amp;lt;wa1&amp;gt; to &amp;lt;i_diff23&amp;gt;.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&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;  if &amp;lt;i_diff23&amp;gt; is assigned.&lt;/P&gt;&lt;P&gt;    i_diff = &amp;lt;i_diff23&amp;gt;.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 05:52:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067100#M1354903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-25T05:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two internal tables: Problem appending diff table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067101#M1354904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check Ankur's post above for creating &amp;lt;wa1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Augustin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 06:01:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-internal-tables-problem-appending-diff-table/m-p/6067101#M1354904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-25T06:01:43Z</dc:date>
    </item>
  </channel>
</rss>

