on 2005 Jul 19 10:40 PM
Does anyone know how to use a Z*-program to write entries to the database log table DBTABLOG?
The reason I'm asking is we have a batch job to update table T001b. Due to the Sabine-Oxlay requirements, I need to add entries to DBTABLOG each time that batch job updates the table T001b so that auditors can use transaction s_alr_87003642 (go to utilities -> change logs) to see who made changes to table T001b.
Basically, I need to minic how DBTABLOG entries are created when s_alr_87003642 is called to update T001B.
I found out that each T001b line change thru s_alr_87003642 results in 3 new lines in DBTABLOG. The first line has LOGKEY = VB, the third line has LOGKEY = VE.
I can use debug to see how DBTABLOG-logdata(has LRAW data type) is created in the first line and the third line. But debug will not stop at anywhere the second line's DBTABLOG-logdata is created!
So I have trouble to create DBTABLOG-logdata and DBTABLOG-logid for the second line.
If anyone ever wrote directly to DBTABLOG, please tell me how to load information into DBTABLOG fields of LOGDATA and LOGID.
Thanks,
Ruthy
If your requirement is to simply have a log of the changes to T000b, then isn't the standard logging being done by SAP and report-able via SCU3 enough?
Also - has anyone actually experienced performance/locking problems referred to when enabling rec/client?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Christian, Andreas, and Ajay;
Thank you very much for reminding me to check SCU3 and ST05 (trace).
In trace list, when I put the cursor on the line which executes the insert to table DBTABLOG, then click ABAP display, it took me to UPDATE T001B. It just wont show how DBTABLOG entries was added! This only happened when I click on object DBTABLOG. If I click on any other objects, it will show me the real codings!
May be the codings to update DBTABLOG are inside UPDATE command (controlled by log change flag and rec/client parameter), therefore, we cannot see it in any ABAP programs?? Please advise.
Ruthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ruthy,
looks quite easy to test your theory:
If update statement includes logic for dbtablog, then just make a little report with a single update inside. Then new entries in dbtablog / SCU3 should be visible. (And afterwards change back.)
My guess: it will work - if not, we can think about a different test.
Regards,
Christian
Yes, Christian, your suggestion did work. Thanks.
And that confirms that DBTABLOG update is happened inside SAP commands INSERT, UPDATE, and DELETE.
I think LOGDATA contains before change non-key data. But I have trouble to figure out LOGID field, for example, LOGID value "373029atcgpa130306". I know the first 6 digits are date and time in microseconds (eg. 373029), followed by host name (eg. atcgpa13). But I could not figure out where the 306 was from. I believe 306 is some kind of system parameter.
Does anyone happen to know where is the last 4 digit from??
Thanks,
Ruthy
Hi Ruthy,
like Ajah I always thought of this log as given functionality.
If we are wrong: make a change in a transaction and run a SQL-trace. Search for update of the log tables, jump to the source code and place a break-point.
Make a second change (maybe including update debugging) and wait for the break-point to stop the execution. Now you can see in the calling history, which functions were used by SAP.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rutthy,
can't you use transaction <b>SCU3</b> to analyse
changes in T001B
regards Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Won't DBTABLOG entries be written by the system when you update T001B (in a Z program)?
My understanding was that such entries would be written as long as table's technical setting is to log changes, and rec/client parameter is set in the profile parameters. A simple update/delete/insert shall trigger the log recording based on these, is what I understood of it.
cheers,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
115 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.