[go: up one dir, main page]

0% found this document useful (0 votes)
457 views1 page

SAP ABAP - Update Function Module - Short Summary

An update function module performs database modifications and registers itself for later execution with CALL FUNCTION in UPDATE TASK. It will only commit changes to the database if the calling program explicitly issues a COMMIT WORK, so any errors after the function module is called will not save data. Update function modules are assigned a priority level and execute pending changes when the calling transaction commits.

Uploaded by

ehtesham faizan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
457 views1 page

SAP ABAP - Update Function Module - Short Summary

An update function module performs database modifications and registers itself for later execution with CALL FUNCTION in UPDATE TASK. It will only commit changes to the database if the calling program explicitly issues a COMMIT WORK, so any errors after the function module is called will not save data. Update function modules are assigned a priority level and execute pending changes when the calling transaction commits.

Uploaded by

ehtesham faizan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

UPDATE FUNCTION MODULE

EXCERPT FROM THE SAP DOCUMENTATION: Function module for which the property update module
is selected in Function Builder. It is the basis of the update function. An update function module
generally performs modifying database accesses and the statement CALL FUNCTION ... IN UPDATE
TASK can be used to register it for execution later with the statement COMMIT WORK. When an
update function module is created it is assigned either a high or low priority level.

SCENARIO:

Let’s understand this with a scenario on how UPDATE FUNCTION MODULE would work.

For example, you have a transaction/program which saves the data into the table using an UPDATE
FUNCTION MODULE. So, upon clicking on the SAVE button in your transaction if the UPDATE
FUNCTION MODULE is executed but for some reason there is an error reported in the further part of
the logic then what would happen? Will the data still be written into the Database?

This is exactly where we see the magic of the UPDATE function module. Since the
transaction/program ends up in ERROR (even after UPDATE FUNCTION MODULE is called) the update
to the DB is NOT DONE as the LUW is not complete and the explicit COMMIT WORK is not
encountered. Function modules called in update task wait for a COMMIT WORK to be executed
explicitly in the calling program.

SYNTAX:

Figure 1. Syntax to call an update function module

Figure 2. Here, F1 and F3 are executed in the update task because the COMMIT WORK for the main program triggers their
execution. However, since transaction ZABC contains no COMMIT WORK statement, the function F2 is never executed by the
update task.

You might also like