02-09-2007 11:24 AM
Hi,
I have 2 tables to update one after the other...
I have geard it is advisable to use update function module for this..
can any1 tell me how to create and work with update function modules...
Answers will be rewarded....
02-09-2007 11:27 AM
Hi Abhay,
When creating a update function module, in the attributes of the FM in Processing Type block, select the "Update Module" radiobutton and under it Start Immediately.
This would make the FM a update function module.
Call it like a natural FM, but it will get executed ONLY when the program comes across a explicit COMMIT WORK statement.
Regards,
Aditya
02-09-2007 11:32 AM
Hi Aditya,
Thanks for the answer,...
But do I need to create two FM's for 2 database tables or only 1 FM and where should I write the COMMIT WORK...
02-09-2007 11:45 AM
Abhay,
How an update function module works is, the execution of the FM is delayed to until when a COMMIT WORK statement is executed.
Hence if you have the data available for updating the two DB tables at the time of calling the FM, you can pass the tables to the same FM and program the DB update for both in the same FM.
However the COMMIT WORK should be outside the FM further down in the calling program.
This link is very good and easy to follow
http://help.sap.com/saphelp_erp2005vp/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm
Hope it helps
Aditya[url=http://help.sap.com/saphelp_erp2005vp/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm]
Message was edited by:
Aditya