Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Log data Changes

Former Member
0 Likes
10,156

Hi ,

Could any one say me where are the log changes stored when any user make changes in the database table as i have clicked the checkbox for <b>LOG DATA CHANGES</b> in Technical setting.

Regards.

13 REPLIES 13
Read only

manuel_bassani
Contributor
0 Likes
3,909

Hi,

tables CDHDR, CDPOS are header and item of changes documents.

You can also use FM CHANGEDOCUMENT_READ to get the change documents.

Regards, Manuel

Read only

0 Likes
3,909

Hi,

I have to write a report whoes out is displaying the user who changed and also the change made in the DBase table.

Thanks.

Read only

0 Likes
3,909

In the CDHDR table there is USERNAME field.

In CDPOS table there are VALUE_NEW and VALUE_OLD.

Use them in your report.

Regards,

Ravi

Read only

Former Member
3,909

Hi Aima,

This is what the f1 help says,

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).

Regards,

Ravi

Read only

Former Member
0 Likes
3,909

Hi

Changes are logged in tables CDHDR, CDPOS .

You can use FMs CHANGEDOCUMENT_READ_HEADERS

CHANGEDOCUMENT_READ_POSITIONS , to retrieve data.

Regards

Kalpana

Read only

0 Likes
3,909

Hi kalpana ,

Thanks for ur sharing ur knowledge.

Is it possible to figure out wat were the changes made by the user ?

will these FM CHANGEDOCUMENT_READ_HEADERS

CHANGEDOCUMENT_READ_POSITIONS gives me the changes made?

Regards.

Read only

Former Member
0 Likes
3,909

Yes,

VALUE_NEW, VALUE_OLD in CDPOS will tell you what were the changes .

- Kalpana

Read only

0 Likes
3,909

Hi,

try this:


parameters: class like  cdhdr-objectclas,
            id    like  cdhdr-objectid.

data: xcdhdr type table of cdhdr with header line,
      xcdred type table of cdred with header line.

call function 'CHANGEDOCUMENT_READ'
  exporting
    objectclass                     = class
   objectid                         = id
  tables
    editpos                         = xcdred
 exceptions
   no_position_found                = 1
   wrong_access_to_archive          = 2
   time_zone_conversion_error       = 3
   others                           = 4.

loop at xcdred.

  write: / 'USER:', xcdred-username,
           'TABLE:', xcdred-tabname, 'FIELD:', xcdred-fname,
           'OLD VALUE:', xcdred-f_old,
           'NEW VALUE:', xcdred-f_new.

endloop.

please remember to reward points for useful answers and to close thread when the problem is solved.

Regards, Manuel

Read only

0 Likes
3,909

Hi Manuel,

What does objectclass and Objectid determines ?

Thanks for guiding me.

Read only

0 Likes
3,909

Object class determine the type of object

example BELEG = FI documents

ObjectID is the key of the object

Example (for FI documents) concatenation of mandtbukrsbelnr+gjahr

Regards, Manuel

Read only

0 Likes
3,909

Hi Manuel,

Thanks for ur reply, For my ztable wat Object class should i give ?

Read only

0 Likes
3,909

You should create a custome object.

transaction SCD0.

1) create a Z_my_change_doc.

2) link the Z table to z_my_change_doc (with trans. SCD0).

please remember to reward points for any helpful answer and close the thread if the problem is solved.

Thanks, Manuel.

Read only

0 Likes
3,909

Hi,

The logging flag defines whether changes to the data records of a table should be logged.

Use: 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.

Steps 1: SE11 - Database Table – Technical Settings – Log Data Changes – Save and back – utilities – Table maintenance generator – create, save.

Follow second step to check your log data changes.

Step 2: SM30 – Table name – display – utilities – change Logs – select start data and end date – execute.

Regards,

Nasreen.