2012 Jan 04 9:39 PM
Hi,
Does anyone knows a way to trigger some kind of event (some program / function)
when a specific standard table changes?
Thanks,
Doron Oded.
2012 Jan 05 2:49 AM
Oded,
the range of your question is very wide. can you please tell us what standard table are you interested in and how are you changing it,
1. from a table maintenance --> Yes, table maintenance events are there which trigger here
2. from a tcode like PO, SO changes -> yes, a variety of events trigger depending upon object type
3. from running any program -> depends upon the program
4. a field for which change pointer is active -> yes, change document write is called.
so please specify what exactly is your requirement
Hi,
Does anyone knows a way to trigger some kind of event (some program / function)
when a specific standard table changes?
Thanks,
Doron Oded.
2012 Jan 05 2:14 AM
Hi Doron,
In general an entry will be created n a table when a record created from standard transaction and for change also.You can try will workflow.Ex:So created,changed,Po displayed, change.Then that even you can use for this.What is the business requirement.
Regards,
Madhu.
2012 Jan 05 2:49 AM
Oded,
the range of your question is very wide. can you please tell us what standard table are you interested in and how are you changing it,
1. from a table maintenance --> Yes, table maintenance events are there which trigger here
2. from a tcode like PO, SO changes -> yes, a variety of events trigger depending upon object type
3. from running any program -> depends upon the program
4. a field for which change pointer is active -> yes, change document write is called.
so please specify what exactly is your requirement
2012 Jan 05 6:01 AM
Hi,
Thanks for your answers.
I know the question is quite general...
The requirement is to trigger a program whenever somw tables changes..
But they don't want to be depend a UE or a specific program.. But a general DB table change.
So, from all the options you mentioned table maintenance event sound the most promising..
What is that? could you elaborate a bit?
Thanks again,
Doron Oded.
2012 Jan 05 6:15 AM
Search.. follow this link.
http://www.sdn.sap.com/irj/scn/advancedsearch?query=tablemaintenanceevents
this explains maintenance view events. but know that this is only when you create data from SM30. its not for any where else.
and about being generic.. WONT help.
UPDATE statement as such wont trigger any event.. so it depends upon where the Update is written, according to that you can look for the events you are talking about
2012 Jan 05 6:25 AM
Hi friend,
You can do like this check the CDHDR and CDPOS table.
From the CDHDR table you will get CHANGENR, OBJECTID and OBJECTCLAS values passing these values to CDPOS, then you will be getting VALUE NEW and VALUE OLD.
So check whether your table is changed and with the help of TMG events or using the driver program where you are checking for the changes call the other program which you want to call.
I think this is much clear if you still face issues please revert back to me i will help you.
Thanks,
Sri Hari
2012 Jan 05 5:50 PM
Hi,
Change documents (CDHDR, CDPOS) could be a solution for this issue. But what about tables which are not change documents managed?
And what is TMG event? and driver program? Could you please elaborate about them a bit more? or tell me where can I find more documentation?
Thank a lot!!
Doron.
2012 Jan 05 5:53 PM
TMG - table maintenance generator - the sm30 thing which i told earlier
and the CDPOS/CDHDR wont get updated automatically. for that also you need to check if the fields are logged or not.
you can activate table logging, but it will activate for all the tables
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eaf9446011d189700000e8322d00/content.htm
Edited by: Soumyaprakash Mishra on Jan 5, 2012 11:25 PM
2012 Jan 05 5:54 PM
Hi Doro,
TMG nothing but table maintenance generator.
Regards,
Madhu.
2012 Jan 05 8:04 PM
Hi,
OK, thats sounds not bad at all.. 2 questions:
1. If we activate Logging (change docs..), will all the tables be included or only a part?
2. How would we know a change has occured? should we scan the table periodically for changes? or is there some trigger/event?
Thanks again, you all are great!
Doron.
2012 Jan 05 8:35 PM
There is the catch... there are 3 things which can be done for table logging
1. system wide(all clients)
2. specific clients(better) -->this one you can go for if you want to
3. no logging
so, this is gonna activate for all tables.
the change can be checked though regular monitoring of SCU3. you can pull out a report and stuff from it.
2012 Jan 05 10:12 PM
To clarify, it takes the setting of rec/client AND the activation of logging for each table in its technical settings to actually activate the logging in table DBTABLOG (not CDHDR/CDPOS, that's something else), so it does not affect all tables.
And no, I don't know of any generic trigger that you can react on within an ABAP context after DB table entries have changed, irrespective of how they were changed.
The functionality that creates the entries in DBTABLOG must be somewhere down in the kernel or database.
Thomas
2012 Jan 05 10:40 PM
The functionality that creates the entries in DBTABLOG must be somewhere down in the kernel or database
Yes. Database layer
2012 Jan 05 10:58 PM
Hi,
When you say "you have to enable it for each table"..
where this should be done?
And, does it require a change request?
Thanks again,
Doron.
2012 Jan 05 11:03 PM
in technical setting(in se11) for any table you will find this logging activated flag. only if the logging flag is set then only you can trace it though SCU3.
go though this link for details
http://help.sap.com/saphelp_nw04/helpdata/en/7e/c81ebb52c511d182c50000e829fbfe/content.htm
Edited by: Soumyaprakash Mishra on Jan 6, 2012 4:35 AM
2012 Jan 06 7:54 AM
My friends,
I'm affraid this is not quite answering my question.. appearantly..
Because this is not a general enough solution, I've checked for example if tables EBAN, and MSEG are logging-enbaled in standard, and I was very dissapointed to see that they are not..
If I need an access key to change these kind of most basic logistics tables, this is the wrong solution.
So, I hope you won't be upset with me if I'll take our wonderfull discussion a bit back, and ask again,
is there a simple way to trigger some program when tables change?
The change could be from any program - SM30, or MIGO, or ME52n... Hence, it (the way) should not be based on the updating program (via UE), It should not require access keys for changing standard table settings..
Thanks again, and I appologize for my stubbornness,
Doron.
P.S: Have a lovely weekend.
2012 Jan 06 9:00 AM
again, you need to specify what are you changing.
say its from SM30, that means you are not changing transactional data(EBAN,EKPO hold transactional data). the data might be some master data or config data.
moreover, if its a customizing table then you will have logs by default, else you need to use maintenance events.
say it from ME22n, ME52n etc. that mean you are changing business documents, mostly these are logged in CDPOS/CDHDR. just like when you click environment->item changes in me23n, it actually reads from CDPOS and CDHDR. you can monitor these tables.
and yes, its a business document means it has a BOR object, BOR object has events like CREATE,CHANGE,DELETE etc etc.. with these event you can link workflows in SWE2. So, when ever any of these events trigger your workflow can trigger and you can put any logic. lets say for PO change you want to do some task, so for BUS2012, change event, you will link a WF. and inside the WF you can do the code..
2012 Jan 06 2:34 PM
The general solution you are looking for is not available, to my knowledge.
EBAN and MSEG are not logged, because they are tracked via change documents (CDHDR/CDPOS) by the application.
Thomas
2012 Jan 07 9:39 PM
Hey guys,
It seams reasonable to check CDHDR and CDPOS in order to track changes to business objects.. But. There are some very important tables that are not documented there.. The most obvious example is MSEG.. It has no change documents management..
So, does any of you know any other method of triggering a program when tables change?
Thanks,
Doron.
2012 Jan 07 10:11 PM
you can go for MB_DOCUMENT_BADI. this badi triggers when a material document is posted.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |