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

List table changes made by specific user?

Former Member
0 Likes
14,136

Hi there,

What is the best way to list all table changes made by a user for a specified time-frame?

I know that either the changes will have to be logged by "log changes" indicator in table technical settings, or logged by change documents.

I would like to explore both to get the most "coverage" - Any help would be appreciated.

I also know that "client/rec" must be set in profile parameters for "log changes" to work.

Are there any SAP standard reports that can do this? I know SCU3 lists changes, but NOT BY USERNAME - I need by username please.

Also is there a SAP standard report to list changes for all activated change documents?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
7,298

Hi ,

U can use Transactions CDHDR and CDPOS for this but prior u have to check

The Log data changes .In CDHDR u have to input userid objectid or objectname .

In CDPOS u have to input change number and object id.

Hope will be helpfull for u.

Regards,

Ravi Kumar

17 REPLIES 17
Read only

Former Member
0 Likes
7,298

Hi ,

Check Tcode STAT and STAD

in STAT check the column DB changes for the user .

Regards,

Vijay

Read only

0 Likes
7,298

Thanks Vijay, but I am already doing this - problem is that it does not tell me what table changes were made - only that there were in fact table changes.

Ideally I need to list values before and after changes...

Read only

0 Likes
7,298

1)In Cdhdr table, if u give username(USERNAME) & date(UDATE) u wil get OBJECTCLAS,OBJECTID,CHANGENR.

2)iN CDPOS table if u pass there values, u wil get

i)TABNAME (tablename)

ii)FNAME(Fieldname)

iii)VALUE_NEW(New Value)

iv)VALUE_OLD(Old Value)

of that particular field.

Hope it solves ur query.

Read only

0 Likes
7,298

Check RM_97 transaction...

Read only

0 Likes
7,298

Thanks vijayalakshmi,

That is helpful - Assuming there is not a SAP standard report to show list of changes for change documents with user and date/time restriction, I will have to use this logic to create my own report.

Next question is about any SAP standard reports or function modules to read changes logged by system where the table is marked to "log changes"...?

Read only

0 Likes
7,298

Hi David

For SAP standard FM,

changes can be found by using fm

1)changedocument_read_headers,-header level (cdhdr table)

2)changedocument_read_positions-item level(cdpos table)

3)changedocument_read

Hope this wil help u,

Regards,

Viji

Read only

0 Likes
7,298

RE: Check RM_97 transaction...

Rama - Unfortunately I do not have this transaction...

Read only

Former Member
0 Likes
7,298

Hi,

You can check the Tables CDHDR and CDPOS for the different changes made by users on each table and field.

Regards,

Anji

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
7,298

Hi David

Check Tables CDHDR (Change document header)

and CDPOS(Change document Item) tables

for the different changes made by users on each table and field.

Regards,

Kumar

Read only

Former Member
0 Likes
7,298

refer to this blog ..<a href="/people/erwan.lebrun/blog/2007/03/09/documents-how-to-track-changes-through-abap:///people/erwan.lebrun/blog/2007/03/09/documents-how-to-track-changes-through-abap

regards,

vijay

Read only

0 Likes
7,298

Thank you everyone for all your help - It seems that change documents will be easy to track...

Any suggestions for the logs of changes to tables marked to "log changes" in technical settings..? I think it saves to DBTABLOG - Any function modules or programs I should refer to or use?

Thanks

Read only

0 Likes
7,298

For anyone reading this later, there is a good program to look at in SAP to read change documents - RSSCD1TS.

Very generic and easy to use.

Read only

Former Member
0 Likes
7,299

Hi ,

U can use Transactions CDHDR and CDPOS for this but prior u have to check

The Log data changes .In CDHDR u have to input userid objectid or objectname .

In CDPOS u have to input change number and object id.

Hope will be helpfull for u.

Regards,

Ravi Kumar

Read only

0 Likes
7,298

Ravi,

CDHDR / CDPOS store <b>change document</b> changes, not <u>logged changes</u>.

Please correct me if I am wrong...

I think changes logged because the table has been marked to "<u>log changes</u>" in technical settings are stored in DBTABLOG - I need away to read this data. This table has a RAW field which I need to be able to interpret..

Read only

0 Likes
7,298

if you are going to activate logging - be aware that it's goingot log ALL changes for ALL users for all tables which have "log data changes" selected in technical settings.

You can use RSVTPROT to analyze logs, and you'll need to delete (archive) logs when no longer required otherwise they'll grow really fast.

(check RSTBPDEL for log deletion).

I think it was mentioned already that you can use RSSCD1TS as an example of the report to list changes based on change documents (no logging is required here). change documents are saved in CDHDR/CDPOS.

Read only

0 Likes
7,298

Thanks Siarhei - We have had change logging on for a while now in the prod system and we do archive etc...

Report RSVTPROT is called by SCU3 - I need to be able to report by <b>username</b>, <b>date</b> and <b>time</b> for all tables that are logged...

Change documents are not a problem any more.

Read only

0 Likes
7,298

David,

check the logic in RSVTPROT around FM DBLOG_READ_WITH_STATISTIC, you'll see how SAP reads logs and formats....besides this FM contains table parameter for usernames ;o) you can try to play with it a bit.

I believe the field LOGDATA of DBTABLOG table contains values of all non-key fields of logged table. So, if you want to parse logdata - you'll need to retrieve dictionary info for logged table & then parse field based on field type/length of non-key fields. (like SAP does it in logs_modernise form.