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

Change document logs for ZTABLE

0 Likes
5,100

Hi ,

One of my clients requirement is to fetch the information of changed fields of a ztable. Where can i get the information of changed fields. DBTABLOG just provides change log it does not give the details of changed fields. I tried checking log changes and got the information from change logs but i want the changed field information in my program. Is there a way out.? Any table that stores the changed field information?. I also checked CDPOS and CDHDR but it didnt have the information of the changed field of ZTABLE. Moreover i checked change document in data element of required field but that did not help. I have also created an object class and generated the "****WRITE" FM and tried using it in event 01,02 of table but that didnt help as i am unable to fetch old values of the field.
Please help.

Thanks

Dilit

1 ACCEPTED SOLUTION
Read only

RatneshSisodiy1
Active Participant
0 Likes
3,979

This message was moderated.

Hi ,

One of my clients requirement is to fetch the information of changed fields of a ztable. Where can i get the information of changed fields. DBTABLOG just provides change log it does not give the details of changed fields. I tried checking log changes and got the information from change logs but i want the changed field information in my program. Is there a way out.? Any table that stores the changed field information?. I also checked CDPOS and CDHDR but it didnt have the information of the changed field of ZTABLE. Moreover i checked change document in data element of required field but that did not help. I have also created an object class and generated the "****WRITE" FM and tried using it in event 01,02 of table but that didnt help as i am unable to fetch old values of the field.
Please help.

Thanks

Dilit

7 REPLIES 7
Read only

RatneshSisodiy1
Active Participant
0 Likes
3,980

This message was moderated.

Read only

0 Likes
3,979

Hi Ratnesh,

I have already tries this. The problem is we have to create a program for this. I want to update CDPOS and CDHDR via SM30 if possible. That is if possible i need to call the FM '**WRITE" in events of the table but the problem is when i do that i don't get the old values of the changed field. I tried event 01,02,07 but it didnt help. Any other suggestions ?

Thanks

Dilit

Read only

0 Likes
3,979

Hi Dilit,

1. All of the data elements in your table should have change log active.

2. You will have to store the original record anytime a record is changed. For that you may use event 21. Whenever 21 is triggered, get record from table total with the key that's being changed and append that to a global internal table.

3. You can use event 01 in TMG, to create change documents. Compare the current values in total table with the ones which got changed and submit old and new records to the change document function module.


Thanks,

Juwin

Read only

0 Likes
3,979

Thanks Juwin !!

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,979

DBTABLOG just provides change log it does not give the details of changed fields.

Are you sure , did you notice field LOGDATA is a cluster of data (same kind of solution than table CDCLS behind CDPOS)

Hints:

Take a look at transaction SCU3, also it's time to look for available online documentation  as Customizing (BC-CUS) : Customizing System Setting (BC-CUS), Logging Customizing Objects , Analyzing Change Logs / List Change Logs . Also look at Function Modules with name starting with DB as DBLOG_READ, DBLOG_READ_TABLE, DBLOG_READ_ARCHIVES, ect. (And my answer in Get old and new values from DBTABLOG table thread.)

Regards,

Raymond

Read only

Former Member
0 Likes
3,979

If change log for tables are enabled in system, you can check SCU3 for logs. It should solve your issue.

Read only

former_member184158
Active Contributor
3,979

Hi,

yes, there is away to know which field has been changed, I have created a program, and I have changed field, then I got it, I can share you some information about it, may it help you.,

it is better to make a copy as internal table, and any change in any field of table, it will be written in cdhdr and cdpos.

The most thing which should be token in consideration,

1. Date element should be checked as change document

2. After calling the FM, Write_Document , the commit work should be called.

In program, don't forget this statement " Commit Work" otherwise wont write the change document,

#

If you still face any problem, just let us to know. 

Regards

Ibrahim