The way to bundle database changes together inside an SAP LUW is to create an update function module, You can create update function module via SE37 Transaction code. just like any normal function module, the only different is that update function module have a different processing type.

how-to-create-function-module

When you select update module processing type, you have several different processing options. you should choose the Start immed option because update module to be processed immediately by update task whenever the transaction is commited via COMMIT WORK.

We will create update function module called ZFM_TEST1 that adds NAME and Address record to ZTB_TEST table, As a rule you should avoid implementing a lot of program logic inside of update module, for example any validation logic should be outside update function module.

Another thing when you develop update function module, you can’t execute statement that may generate database commit for examples : COMMIT WORK, CALL TRANSACTION.

To invoke ZFM_TEST1 update function module, you must use the IN UPDATE TASK addition of the CALL FUNCTION statement. The code excerpt shown below.

When COMMIT WORK statement execute ZFM_TEST1 ansynchronously in update task, you can use the AND WAIT addition of COMMIT WORK statement to cause the current process to wait until the high priority update are finished.

how-to-create-update-function-module-1

Incoming search terms:

Leave a Reply

Your email address will not be published. Required fields are marked *