"Transfer from http://blog.csdn.net/zhongguomao/article/details/6712568"
Function module:
The updater must be implemented with a special FM (update module).
1.Exporting exception parameter is ignored
The update module, like the other FM, has an interface for transmitting parameters, but only importing and tables, and the type can only be referenced or structured, and the exporting and exception parameters are ignored in the update module.
2.Commit work or Roll back to work only
The update module contains the actual database update statements.
The FM that uses this notation is not executed immediately, but is written into the log TABLE, and as an execution request, an update request under an SAP LUW is stored under the same update key for an SAP LUW. Update key is a unique world-wide identifier, That means an SAP LUW.
Update key is unique and does not duplicate the update key of another SAP LUW.
Only when the program executes to the commit work will a header entry log header be created for these requests, indicating that these same update keys belong to the same package, and then the system shuts down the LUW.
When the log header is created, the system notifies dispatcher that an update package is ready to be processed.
COMMIT work [and WAIT (synchronous)].
If you use the and wait option, it waits until the end of the update task (the process waiting to update the database table) before the program resumes execution. If the update is successful, the SY-SUBRC is set to 0. If SY-SUBRC returns a value other than 0, there is no successful storage of the changes made.
Update module (updating modules)