‎2016 Sep 08 2:24 PM
HI,
I have created SM30 for 2 tables say A & B with validations & logic in both the tables, which is having same primary keys for both the tables. So now the question is when user enters a primary key in table A same should be updated in table B automatically and when user removes entries from table A same should be deleted from table B automatically, this should work for multiple addition or deletion.
Need help on this
Regards,
Watch-point.
‎2016 Sep 08 2:33 PM
‎2016 Sep 08 2:36 PM
Hi,
This can be done through Table Maintenance Events
Event for your use is --02 After saving the data in the database--
Details given in below link
TABLE MAINTENANCE GENERATOR and ITS EVENTS - ABAP Development - SCN Wiki
‎2016 Sep 08 2:36 PM
Did you consider creation of a View Cluster, first step would be correct foreign key relation between your tables.
Regards,
Raymond
‎2016 Sep 08 2:48 PM
Hi Raymond & Andre,
Yes I am considering View cluster in the event 5 whether work center is allocated to the plant & material is for valid for the plant or not same kind. I have written code in PBO for insert & at event 5 to delete the entry but this is not working for multiple insert & delete.
Regards,
watch-point.
‎2016 Sep 08 2:54 PM
You do not need to implement table maintenance events. And please avoid changing the standard code generated by maintenance generator.
Just have a close look on the View Cluster. I think it will fit your needs.
‎2016 Sep 08 3:06 PM
Hi Andre,
I am using event because for some of the fields three tables are involved based on the entries of each table the validation changes and when it comes to PBO I have created separate Z module and calling that to insert & delete.
Regards,
‎2016 Sep 08 8:36 PM
Did you consider creating one table and 2 projection views with distinct maintenance dialogs?