<?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: How To Find Differing Columns Between Internal Tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-find-differing-columns-between-internal-tables/m-p/3988369#M952810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was late, my answer was the same:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If structures are identically you may use code like this.&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
  DO.
    ADD 1 TO lv_comp_no.
    ASSIGN COMPONENT lv_comp_no OF STRUCTURE gs_struct1 TO &amp;lt;lfs_value1&amp;gt;.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    ASSIGN COMPONENT lv_comp_no OF STRUCTURE gs_struct2 TO &amp;lt;lfs_value2&amp;gt;.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.  
    IF &amp;lt;lfs_value1&amp;gt; NE &amp;lt;lfs_value2&amp;gt;.
    ... 
    
   ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Holger&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Holger Pakirnus on Jun 19, 2008 6:56 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jun 2008 16:55:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-19T16:55:11Z</dc:date>
    <item>
      <title>How To Find Differing Columns Between Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-find-differing-columns-between-internal-tables/m-p/3988367#M952808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen this question arise on the boards before but have been unable to find a good solution.  I have two identical structures coming into a function module.  For context, this is a BTE that fires when an FI document is modified.  It passes in 1 structure with the old header data and 1 structure with the new header data so that you can see what was changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need an efficient way to find which fields have changed (e.g. which fields in the two structures that have different values).  We need to fire off a process if certain fields were changed.  I was looking for a graceful way to do this without having to hardcode all 100+ field names to compare.  Any ideas?  I've played around with getting the structure components from CL_ABAP_TYPEDESCR but have been unsuccessful in using the results to loop through and dynamically check each field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Seth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 16:31:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-find-differing-columns-between-internal-tables/m-p/3988367#M952808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T16:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: How To Find Differing Columns Between Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-find-differing-columns-between-internal-tables/m-p/3988368#M952809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could make a simple compare if they have the same structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;struct1 = struct2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the return is false do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
do.
assign component sy-index of structure struct1 to &amp;lt;fs&amp;gt;.
if sy-subrc ne 0.
exit.
endif.
assign component sy-index of structure struct2 to &amp;lt;fs2&amp;gt;.
if sy-subrc ne 0.
exit.
endif.
"Compare each field
enddo.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But again, would only work if the structures are the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 16:49:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-find-differing-columns-between-internal-tables/m-p/3988368#M952809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T16:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: How To Find Differing Columns Between Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-find-differing-columns-between-internal-tables/m-p/3988369#M952810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was late, my answer was the same:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If structures are identically you may use code like this.&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
  DO.
    ADD 1 TO lv_comp_no.
    ASSIGN COMPONENT lv_comp_no OF STRUCTURE gs_struct1 TO &amp;lt;lfs_value1&amp;gt;.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    ASSIGN COMPONENT lv_comp_no OF STRUCTURE gs_struct2 TO &amp;lt;lfs_value2&amp;gt;.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.  
    IF &amp;lt;lfs_value1&amp;gt; NE &amp;lt;lfs_value2&amp;gt;.
    ... 
    
   ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Holger&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Holger Pakirnus on Jun 19, 2008 6:56 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 16:55:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-find-differing-columns-between-internal-tables/m-p/3988369#M952810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T16:55:11Z</dc:date>
    </item>
  </channel>
</rss>

