2015 Aug 13 8:47 AM
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
2015 Aug 13 8:56 AM
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
2015 Aug 13 8:56 AM
2015 Aug 13 9:02 AM
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
2015 Aug 13 6:18 PM
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
2015 Aug 14 10:22 AM
2015 Aug 13 9:24 AM
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
2015 Aug 13 9:31 PM
If change log for tables are enabled in system, you can check SCU3 for logs. It should solve your issue.
2015 Aug 14 2:11 AM
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