<?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 Store changed data in different table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066213#M1504051</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where in I want to store changed data from one Z table into another. When I make any changes to the existing data in one Z  table I need to log the changes (old values) in another Z table. I have tried to check events in table maintainence generator, but do not get the old values in any event. Apart from using a module pool is there a way using events for a table maintenance where in changes/deletions can be recorded into another table(history table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jul 2010 08:47:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-26T08:47:30Z</dc:date>
    <item>
      <title>Store changed data in different table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066213#M1504051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where in I want to store changed data from one Z table into another. When I make any changes to the existing data in one Z  table I need to log the changes (old values) in another Z table. I have tried to check events in table maintainence generator, but do not get the old values in any event. Apart from using a module pool is there a way using events for a table maintenance where in changes/deletions can be recorded into another table(history table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jul 2010 08:47:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066213#M1504051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-26T08:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Store changed data in different table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066214#M1504052</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 activate the "log table changes"  in technical setting of your Ztable in SE11 , then use SCU3 to analysis the changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jul 2010 09:23:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066214#M1504052</guid>
      <dc:creator>pole_li</dc:creator>
      <dc:date>2010-07-26T09:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Store changed data in different table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066215#M1504053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this code snippet in Event '01' of the TMG:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: f_index LIKE sy-tabix, "Index to note the lines found
        st_zabc TYPE zabc,
        it_zabc_old TYPE STANDARD TABLE OF zabc,
        st_zabc_old TYPE zabc.

  BREAK-POINT.

  LOOP AT total.
    IF &amp;lt;action&amp;gt; = aendern.
      READ TABLE extract WITH KEY total.
      IF sy-subrc EQ 0.
        f_index = sy-tabix.
        st_zabc = total.

        SELECT SINGLE * FROM zabc INTO st_zabc_old
          WHERE zzf1 = st_zabc-zzf1
          AND   zzf2 = st_zabc-zzf2.
        CHECK sy-subrc = 0.
        APPEND st_zabc_old TO it_zabc_old.
        CLEAR st_zabc_old.
      ELSE.
        CLEAR f_index.
      ENDIF.
      "(make desired changes to the line total)
      MODIFY total.
      CHECK f_index GT 0.
      extract = total.
      MODIFY extract INDEX f_index.
    ENDIF.
  ENDLOOP.

" You can use the table IT_ZABC_OLD to save the old data to another table.

  sy-subrc = 0.&lt;/CODE&gt;&lt;/PRE&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;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jul 2010 09:59:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066215#M1504053</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-07-26T09:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Store changed data in different table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066216#M1504054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help Suhas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jul 2010 12:34:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/store-changed-data-in-different-table/m-p/7066216#M1504054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-26T12:34:39Z</dc:date>
    </item>
  </channel>
</rss>

