2008 May 06 7:11 AM
Dear friends,
I have a custom Z-table created in my ERP system. To this table I have created a table maintenance generator to enable updation of values.
Whenever a new record is inserted/deleted in this table or any existing record in this table has been changed, then a FM needs to be triggered immediately with details of the record that has been inserted or updated.
This FM has to be triggered immediately and not by running a batch job in the background.
Pls help me with the details for achieving the same. Awaiting your valuable inputs.
Best Regards,
Gayathri.
2008 May 06 7:34 AM
You can do this in events of table maintenance generator. Have a look at below link for details of how to use the events:
[Table Maintenance Events|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc]
Let me know if any doubts.
I hope it helps.
Best Regards,
Vibha
Please mark all the helpful answers
Dear friends,
I have a custom Z-table created in my ERP system. To this table I have created a table maintenance generator to enable updation of values.
Whenever a new record is inserted/deleted in this table or any existing record in this table has been changed, then a FM needs to be triggered immediately with details of the record that has been inserted or updated.
This FM has to be triggered immediately and not by running a batch job in the background.
Pls help me with the details for achieving the same. Awaiting your valuable inputs.
Best Regards,
Gayathri.
2008 May 06 7:21 AM
When you created a table maintenance generator, then a function module get autometically generated that used to update the table in database when you use table maintenance for data updetion.
You will find the function group by the following path:
SE11-> open the table -> Utilities -> table maintenance generator.
Now this autometically created function group can be changed according to your requirements. There you will find the point where when you table is getting uodated ( you will also get the screen no there which is used to update your table, search the PAI of that screen), and if the updetion is successful then add code ( call FM in your case) according to your requirements.
For more hints to get that perticular point, search the following path in the screen of the function group:
MODULE LISTE_UPDATE_LISTE -> PERFORM update_tab
-> PERFORM update_entry -> MODIFY extract
2008 May 06 7:28 AM
Hi,
Find out the function group.
And go for the PAI module of your screen
There you can write the function module . for what you want to perform the action.
it will work.
Regards,
Madan.
2008 May 06 7:34 AM
You can do this in events of table maintenance generator. Have a look at below link for details of how to use the events:
[Table Maintenance Events|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc]
Let me know if any doubts.
I hope it helps.
Best Regards,
Vibha
Please mark all the helpful answers
2008 May 06 7:42 AM
Hi,
Pls find below the link which will automatically update the user and the date whenever the table has a new entry or changed in table maintenance generator.
If you have any doubts please get back to me as I am also currently working on a similiar object.
Also other than as shown in the attached PDF you can also write the following code in EVENT '01'.
FORM update_user_date_time.
DATA: f_index LIKE sy-tabix.
DATA: BEGIN OF l_total.
INCLUDE STRUCTURE zztable.
INCLUDE STRUCTURE vimtbflags.
DATA END OF l_total.
DATA: s_record TYPE zztable.
LOOP AT total INTO l_total.
IF l_total-vim_action = aendern OR
l_total-vim_action = neuer_eintrag.
MOVE-CORRESPONDING l_total TO s_record.
s_record-zz_user = sy-uname.
s_record-zz_date = sy-datum.
s_record-zz_time = sy-uzeit.
READ TABLE extract WITH KEY l_total.
IF sy-subrc EQ 0.
f_index = sy-tabix.
ELSE.
CLEAR f_index.
ENDIF.
MOVE-CORRESPONDING s_record TO l_total.
MODIFY total FROM l_total.
CHECK f_index GT 0.
MODIFY extract INDEX f_index FROM l_total.
ENDIF.
ENDLOOP.
ENDFORM. " UPDATE_USER_DATE_TIME[/code]
Here ZZTABLE is the Z table and ZZ_USER, ZZ_DATE, and ZZ_TIME are the fields that are updated.
Reward if found helpful.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |