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: 

How two create UPDATE FUNCTION MODULE

Former Member
0 Kudos

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....

3 REPLIES 3

Former Member
0 Kudos

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

0 Kudos

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...

0 Kudos

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