Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg:Events In Table Maintenance Generator

former_member585865
Contributor
0 Kudos

Hi All,

i have created a table maintenance Generator,when ever i save or change or delete it should reflect in another database table,i came to know this can be achieved through events, for saving i know 02 event i have to write code, now my doubts are,

1. how to write code in events through function module

2. i can create a module in PAI and write code to save in the database table then how will it be link with the events.

3. since for the first time am doing this,could you provide some sample code for event 02 and explain briefly.

4. While Coming to Events Point there is no values could you explain how can i use events.

Edited by: suresh suresh on Jul 24, 2009 2:31 PM

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

You may use Event 'AB' for [Event AB: Instead of the Standard Database Changes Routine|http://help.sap.com/saphelp_nw2004s/helpdata/EN/91/ca9f59a9d111d1a5690000e82deaaa/frameset.htm]

You just have to duplicate the FORM DB_UPD_<viewname> (for a view) or TABLE_DB_UPD (for table) in the AB form, and add your code. (Look also at [Extended Table Maintenance Events|http://help.sap.com/saphelp_nw2004s/helpdata/EN/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm])

Regards,

Raymond

9 REPLIES 9

Former Member
0 Kudos

use wizard for making table control. you your self will find all code being written by the wizard. you can just modify that to the way you need it.

Former Member
0 Kudos

hi

In event for table maintainace>double click on editor tab>

u can call your function module with table updation logic in include for that event.

hope this helps

0 Kudos

Hi Kanchan & Soumya,

Thanks for quick reply, whether i need to create to some Zfunction Module or is any standard there?

could you please explain me the purpose of events, and how to link with that, in the module which i have coded in the PAI.

how to link these two?

raymond_giuseppi
Active Contributor
0 Kudos

You may use Event 'AB' for [Event AB: Instead of the Standard Database Changes Routine|http://help.sap.com/saphelp_nw2004s/helpdata/EN/91/ca9f59a9d111d1a5690000e82deaaa/frameset.htm]

You just have to duplicate the FORM DB_UPD_<viewname> (for a view) or TABLE_DB_UPD (for table) in the AB form, and add your code. (Look also at [Extended Table Maintenance Events|http://help.sap.com/saphelp_nw2004s/helpdata/EN/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm])

Regards,

Raymond

0 Kudos

Hi Raymond,

Thanks for your reply,since am new to this type of development, i had some more questions could you please clarify,

1. i will create a module in PAI and during save i will update in the another database then what to do with the event 02 part.

2. could you please say how to write code in events through function module?

3.do you have any sample code so that i can understand a bit easier way.

0 Kudos

You don't need any FM here, just call SE54, access event, add a FORM and copy in it one template (specified above) and add your code in it .

- TOTAL is the data from screen.

- EXTRACT is the data from database.

Just insert your code, you should not have to do anything with FM or in the dynpro PAI.

To copy the template, call SE37 and display the Function Group associated to the maintenance dialog, then display main program and use icon to search the template forms. (FORM DB_UPD*)

Regards,

Raymond

0 Kudos

Hi Raymond,

i have found out the form in the program,

Form TABLE_DB_UPD *

----


  • process data base updates/inserts/deletes

i found the code below,

DELETE (x_header-maintview) FROM TABLE <mod_elem_tab>.

i have just inserted the code right below the statement,

DELETE <second table name> FROM TABLE <mod_elem_tab>.

similarly i have inserted for insert and modify whether this is enough to achieve my scenario?

i have specifically ask for a requirement below,

*Any code written inside the event should be in Function Modules ONLY. *

that's y i asked how to write code in events through function module?

Edited by: suresh suresh on Jul 27, 2009 5:47 AM

0 Kudos

Just create your function modules in the function group of the maintenance dialog, so the data will be available. But for single database operation, there is no actual interest to do that with FM, the maintainability of the program will be decreased in this peculiar case.

Regards,

Raymond.

0 Kudos

Hi Raymond,

Really thanks for your support. the problem has been resolved.

Edited by: suresh suresh on Jul 28, 2009 12:44 PM