Logging changes in any table

Hi,
Is it possible to track changes in a schema by writing own code? What i want to achieve is to write something that will 'catch' any insert or update to any table in my schema and writes a log to my table.
Thank you very much
lubos

Here is what SAP says as a F1 help on the logging flag in technical setting of a table..
Log data changes
The logging flag defines whether changes to the data records of a table should be logged. If logging is activated, every change (with UPDATE, DELETE) to an existing data record by a user or an application program is recorded in a log table in the database.
Note: Activating logging slows down accesses that change the table. First of all, a record must be written in the log table for each change. Secondly, many users access this log table in parallel. This could cause lock situations even though the users are working with different application tables.
Dependencies
Logging only takes place if parameter rec/client in the system profile is set correctly. Setting the flag on its own does not cause the table changes to be logged.
The existing logs can be displayed with Transaction Table history (SCU3).

Similar Messages

  • Logged changes in Custom Table

    Hi Gurus,
    Need the Transaction code to check logged changes in Customizing Table ....... Something Like V_T510N...
    ...Need to know the USER ID who changed the table......
    NOTE: THIS IS FOR CUSTOMIZING TABLE....Not INFOTYPE or PA Table.
    Kumarpal Jain.

    Hi
    Check SM30->View of your Custom Table Name->Utilities -> change logs.
    Check Tables : CDHDR and CDPOS also.
    Regards,
    Sreeram

  • Oracle Trigger to log changes in a table

    I have a situation where if a new record is created or a modification to a table is made all details of these changes are logged. For example
    A change is made in a customer table, from
    Customername - Andrew
    Customerid - 1
    to
    Customername - John
    Customerid - 1
    The changes would be logged in a separate table of the following format
    TableType - The table the edit or new record appeared in
    Username - The user that made the change
    ChangeDate - Date of change
    Uniqueid - Customer id
    change type - the type of change add or modify
    colname - the column name affected by the change
    oldvalue - the old value
    newvalue - the new value
    therefore for the above example the logtable would be populated as follows:
    TableType - Customer
    Username - athompson
    ChangeDate - 17/01/06
    Uniqueid - 1
    change type - modify
    colname - customername
    oldvalue - andrew
    newvalue - john
    Ok that sums up the aim, all im wondering is if this is possible using Oracle Triggers?
    Any help, advice or possible solutions would really be helpful as im a bit of a trigger newbie :P
    cheers
    AndyT

    Ah okay, the system has been designed and built before all requirements are known and understood and now cannot be changed. This is a common reason for using triggers as a kludge to fill the gaps in the application after the fact.
    Based on the low usage though you should probably be okay, hopefully this will help get you started.
    Also see the SQL and PL/SQL Reference guides
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
    SQL> create table t (n number);
    Table created.
    SQL> create table t_log (table_name varchar2(30),
      2    username varchar2(30), change_date date, change_type varchar2(10),
      3    old_value number, new_value number);
    Table created.
    SQL> create or replace trigger t_after_row
      2  after insert or update on t
      3  for each row
      4  declare
      5    l_type varchar2(10);
      6  begin
      7
      8    if updating then
      9      l_type := 'MODIFY';
    10    elsif inserting then
    11      l_type := 'ADD';
    12    end if;
    13
    14    insert into t_log
    15      (
    16      table_name,
    17      username,
    18      change_date,
    19      change_type,
    20      old_value,
    21      new_value
    22      )
    23    values
    24      (
    25      'T',
    26      user,
    27      sysdate,
    28      l_type,
    29      :old.n,
    30      :new.n
    31      );
    32
    33  end;
    34  /
    Trigger created.
    SQL> insert into t values (1);
    1 row created.
    SQL> insert into t values (2);
    1 row created.
    SQL> update t set n = 3 where n = 1;
    1 row updated.
    SQL> select * from t_log;
    TABLE_NAME   USERNAME     CHANGE_DAT CHANGE_TYP  OLD_VALUE  NEW_VALUE
    T            TEST         01-19-2006 ADD                            1
    T            TEST         01-19-2006 ADD                            2
    T            TEST         01-19-2006 MODIFY              1          3
    SQL>

  • Log changed data in tables

    hi
    I want to hold change data information.
    For example I have table student and one row is inserted.
    Then somebody else changed the name of the student name and phone number.
    I want to hold the changed columns when an update query is executed.
    I looked at change data capture but I think it is about data warehouses and there are 2 databases in that case.
    I do not want to write triggers for all tables.
    I looked at fine grained auditing but I can take the update statement only, I do not know how can I find the changed columns, column's last data and new data.
    How can I do it? Which topic should I research?
    Can you lead me?
    Good Works

    [Flashback Query|http://www.oracle-base.com/articles/9i/FlashbackQuery.php] may be possible. but, There are some restrictions for Flashback query.
    [http://www.oracle-developer.net/display.php?id=210]
    [http://www.dbasupport.com/oracle/ora9i/flashback_Query.shtml]
    [http://www.dbasupport.com/oracle/ora9i/flashback_Query2.shtml]
    [http://www.dbasupport.com/oracle/ora9i/flashback_Query3.shtml]
    Last option is log Minor.

  • Change logs not available for tables

    Hi Experts,
    Is there any change logs available for the  tables PCEC, FTXP, T030
    We need to add logs so that we can keep track of the changes.
    Please let me know if someone knows the solution.
    Regards,
    Srinivas

    Dear Srinivas,
    Go to SE11 and key in your table, then select Display.
    In the top, you will be able to see Technical Settings Button. click on it.
    It will show you the technical details for that table.
    There will be an indicator at the bottom LOG DATA CHANGES.
    If this indicator has been set, then only the changes will be recorded.
    For change log, you shall make use of the transaction SCU3.
    AUT10 shall also be used.
    thank you
    Venkatesh

  • Using a change document for Z table maintenance generatro to log changes

    Hi Forum,
    I have created a a change document for one of the Z tables now I want to use it in the table maintenance generator of this table so that any changes made to this table using maintenance generator are logged in table CDHDR and CDPOS.
    I am using the event 02     After saving the data in the database
    and have created a new FORM..ENDFORM for this event and it is working fine till here.
    But I am unable to find any table or structure where the information of the action performed in maintenance generator is kept for eg. what action was performed like add, delete or change and on how many records and contents of those records.
    I can update the tables CDHDR and CDPOS only if I have the above information.
    Please guide me as to where can I find all this information within the maintenenace generator program?
    Thank you,
    Anubhav

    Hello Anubhav,
    Are you calling the change document function module in your save event ? The function module needs to be first created using SCDO for your Z table, select the fields on which you want to track the changes.  Auto generate the programs for this change object. Once the FM is generated, you will have to call this FM in your SM30 event.
    The change document tracking also needs to be enabled at the data element level..
    Regards,
    Jay

  • How do we find if any changes in a table

    Hi All,
    We have created some tables in an user. when ever we create any table that table name or object name stored in All_objects like that.
    if we see that table (all_objects). we can find when table has created and when last DDL performed on respective tables.
    i would like to know when table has created (when DDL performed )
    along with when DDL performed on that table like
    1> one day i can drop constraints.
    2> one day i can desiable/enable constarints.
    3> one day i can add/change column name/ data type or null to not null.
    4> one day i drop some columns
    i wanted to know when i have created table and when i changed any above mentioned cases. where can we track historical or at least latest changed.
    Regards,
    venkat
    Edited by: user635973 on Apr 2, 2009 12:44 AM

    user635973 wrote:
    Suppose if I create any triggers. It won’t create any problem in database but we are using ORACLE WAREHOUSE BUILDER (OWB 10gr2) for extract, transform and loading. I am sure about OWB creates problem for data extract, transform and loading.
    What to do? Do you have any way to find out? Well, triggers do obviously have a small impact on performance, but that will depend on exactly what you are doing and how much you're doing it.
    How it effects OWB I don't know. The only time I ever used OWB was when evaluating ETL tools and came to the conclusion that it was a) a complete P.I.T.A. to install as the documentation led us all over the place and b) it was only any good at loading data into Oracle, not at getting data out again (certainly not as XML anyway).

  • Table for the report RPUAUD00  Logged Changes in Infotype data

    Hi
    I have a query with the program RPUAUD00 Logged changes in Infotype Data.  In which table stores the details of the program RPUAUD00.  for example in the 1st period there is a LWP record for the employee.  If in the 2nd period the LWP entered in 1st period has deleted, in the log the LWP displays for 1st period  new field contents, Action Indicator I.  The deleted information displayes in Old field contents with the Action Indicator D. We want to know in which table the LWP insert and LWP delete (d) details are stored.
    This information required to create a report for ESI.  In the report No of days (payroll processed for) has to mention.  To know the no of days need to access the report RPUAUD00.  From the RPUAUD00 the details of LWP insert and delete can be known.
    Request to help in solving the issue
    Thanks & Regards
    EKP Yadav

    Hello:
    Logged changes in Infotype Data are stored in cluster table PCL4 ID  LA and SA for employee and LB and SB for applicant. Maybe L is for longterm and S for shorterm
    Cheers.
    Antoine

  • URGENT: What table stores data for logged changes in PA and PD??

    Thanks!!!

    Hi Scott,
    Thanks for the reply.  This transaction leads to the report that allows you to display logged changes in PA, but I need the table name where these changes are actually stored for PA and the other table where change documents are stored in PD.
    Regards,
    -Joe

  • How to enable logging of database changes of  Z tables into a log table.

    Dear Team,
    We have 8 Z tables and we need to log the changes in these tables. Earlier Change Document process was proposed but now we know that the possible changes in the Z tables will be many and this can cause too many entries in CDHDR and CDPOS tables. Going through so many entries of Change Document tables will decrease the system performance. The other option involves enabling the Log data base changes for the Z data base tables, but this will also cause the system to slow down as per SAP F1 help on "Log data changes" checkbox.
    description-"Note: Activating logging slows down accesses that change the table. First of all, a record must be written in the log table for each change. Secondly, many users access this log table in parallel. This could cause lock situations even though the users are working with different application tables."
    So we came to a solution where we can create a Z table and we will log the above mentioned Z table changes in the Z Change table but I have no idea how to implement the suggested solution. Please help me on this.
    Regards
    Amit

    Hi,
    Have a suggestion..
    Have custom fleld as LOG with char 1 and date field (sy-datum) in all the 8 ztables. The ztables are updated either through SM30 or from custom program, making sure who ever changes the record if manually then fill that flag field as 'X' and if by program then populate the field with value 'X'.So you will know based on the flag field whether changed or not.similarly for date field updatin as well.
    Now create a custom program to update the new ztable . Schedule this program daily may be at midnight..Read the 8 ztables with having flag = 'X' and update the new ztable. Once done clear the FLAG  from all the 8 ztables to space for that day and update the date field in the custom program.
    So for that particular day the records were written to new ztable and all the 8 ztables are having flag value as space and date will be sy-datum.
    Now for next day again do the same procedure.
    Hope this gives you an idea.
    Regards,
    Nagaraj

  • Any table stores the logs  of all processes

    Hi,
    Is there any table stores the logs of the process whether it is active/inactive/cancel/successful, etc

    Hi,
    not sure about your requirement, but may be table rspcprocesslog is of some help.
    regards
    Siggi

  • Hi, Since updating to 10.7.2 I cannot make any changes to my web site. I just keep getting the same stupid message asking if I have an account even though I am already logged in. Any thoughts. Thanks

    Hi, Since updating to 10.7.2 I cannot make any changes to my web site. I just keep getting the same stupid message asking if I have an account even though I am already logged in. Any thoughts. Thanks

    Go and log out of your MobileMe account and then try logging back in again with a dummy username and password.  This can help clear it and then just log back in again with your normal username and password.
    Note though that iWeb does not require a password or username to use it - this is MobileMe.
    Also, start thinking about MobileMe alternatives before you are forced to in June.

  • Can text messages in the incompletion log be found in any table?

    We need to store and review the text messages found in the online incompletion log.  Does anyone know if these are stored in a table?  Or if they are always redetermined upon VA01 or VA02 transactions, does anyone know at what point in what program this happens if we need to build our own custom table to capture the messages?

    The incompletion log table is VBUV - Sales Document: Incompletion Log
    I think the table is filled in one of the following:
    > Function module - RV_CHECK_DOCUMENT_INPUT
    > Include - LV45FFUV: FORM FEHLER_BESTIMMEN
    I hope this helps.
    Gerard
    P.s. Also look for structure VBUV_TAB as I think XVBUV comes for here.
    Edited by: Gerard Magorrian on Oct 1, 2010 9:04 PM

  • How to Divert the changes to cdhdr table instead of dbtablog?

    Hai everybody.
    I am new to this forum. i got a job in abap recently. The below is my requirement.I want solution for this one. Anybody plz help me.
    I am having ztransaction.
    The change logs already were captured in DBTABLOG for table ZWPRFRUND (in transaction ZWPG).
    The only report which is currently used to get the change logs is RSVTPROT
    Now my requirement is,
    we need to display the change logs in the form of ALV.
    We should divert the changes to CDHDR table instead of DBTABLOG, then we can use the RSSCD100 to display change logs.
    The Important items for the change LOG needed in case of changes to table in “ZWPG” are,DATE ,TIME,USER,FIRST NAME,FILED NAME,OLD VALUE,NEW VALUE
    The above fields need to be displayed in the grid. In the above list “FIELD NAME” denotes any field of the table in the transaction in “ZWPG”
    Thanks & Regards,
    Sujatha.T.

    Check out my post in this thread:
    How to record add-on table change logs?
    You need to define a change document type and generate relevant code for this.
    Andrew

  • Track changes on 'Z' tables

    Hi,
    We have a requirement that to track changes on our Z tables. Could any one help me in process of doing this ?
    Thank you,
    Surya

    HI,
      U Read follow this for clarifies u r doubt..........
    As with business objects, we recommend that you activate the logging of changes to table data for those tables that are critical or susceptible to audits. (See the SAP – Audit Guidelines R/3 FI, in Section 4.3.5, for examples of important tables. This document is available at
    http://www.sap.com/germany/aboutSAP/revis/infomaterial.asp. You must also explicitly activate this logging. Note the following: 
    ·        You must start the SAP System with the rec/client profile parameter set. This parameter specifies whether the SAP System logs changes to table data in all clients or only in specific clients. We recommend setting this parameter to log all clients in your productive system.
    ·        In the technical settings (use transaction SE13), set the Log data changes flag for those tables that you want to have logged.
    If both of these conditions are met, the database logs table changes in the table DBTABPRT. (Setting the Log data changes  flag only does not suffice in recording table changes; you must also set the rec/clientparameter.)
    You can view these logs using the transaction SCU3.
    Although we do deliver pre-defined settings, you generally have to modify them to meet your own requirements. Use the report RSTBHIST to obtain a list of those tables that are currently set to be logged. Use transaction SE13 to change the Log data changes flag for these or other tables.
    For more information, also see SAP Notes 1916 and 112388.
    regards,
    sudheer.

Maybe you are looking for

  • Multiple IDocs-XI-Single File Scenario

    Hi All,    We need to send multiple IDocs from R/3 to XI and then to a single file using File Adapter. Please help us with your suggestions on how to proceed using a simple solution. Regards, Peter

  • FAQ: How to share images from the Organizer to the Web

    Elements Organizer has a fair share of methods for sending images to the internet or across it to your friends and family directly. Here is a list of resources that helps explain the different functions to accomplish this task. [NOTE: While some of t

  • Native application (captive runtime) doesn't support GameInput?

    I've built a project originally for Flash Player, then for AIR with the GameInput API.  With the addition of GameInput support in FlashPlayer 11.8, I've switched back to FP.  The game supports controller input through the GameInput API when built as

  • Difficulties in initializing PCI6527

    I am trying to setup a PCI627 card with LabView program. After setting up, I couldn't get any voltage outputs by running some very simple single channel output. I ran LabView samplers and still no response. In addition, I measure the voltage on pin 4

  • Feature Request - More text capability

    I use Lightroom for all my photo printing, and would occassionally like to print greeting cards, with titles, location information, etc. printed on the back panel.  Unfortunately, the standard text blocks and identity plate don't provide enough optio