SAP ABAP : Logical Unit of Work(LUW) and function modules
Logical Unit of Work(LUW)
and Function Modules in
Maventic Innovative Solutions Pvt. Ltd.
• Logical Unit
• Overview of
• Types of
Logical Unit of Work(LUW)
From the point of view of database programming, a database LUW is an inseparable
sequence of database operations that ends with a database commit.
• How does SAP mantain consistency in LUW ?
The database changes that occur within a database LUW are not actually
written to the database until after the database commit.
• Can we explicitly Commit or Rollback and LUW ?
To Commit call the FM DB_COMMIT or use APAP command COMMIT
WORK to Rollback we can use the ROLLBACK WORK command in the
• When does a Database LUW Begins?
• Each time a dialog step starts (when the dialog step is sent to the work
• Whenever the previous database LUW ends in a database commit.
• Whenever the previous database LUW ends in a database rollback.
• When does a Database LUW Ends ?
• Each time a database commit occurs. This writes all of the changes to
• Each time a database rollback occurs. This reverses all of the changes
made during the LUW.
Overview of Function Module
• Function modules are procedures that are defined in special ABAP
programs only, so-called function groups.
• Function modules allow you to encapsulate and reuse global
functions in the SAP System. They are managed in a central function
• Function Modules are of three types
• Remote-enabled (RFC)
Workings of a function module
Function Groups :
programs with type
Types of Function Module
Module : Can be
from an SAP or
non SAP System
are used to update
Update Function Module
• Using the function module in updating the database table helps
in updating without any irregularities as its transaction based.
with no restart
• Update with immediate start : Set this option for high priority ("V1") functions that
run in a shared (SAP LUW). These functions can be restarted by the update task in case of
• Update with immediate start, no restart : Set this option for high priority ("V1")
functions that run in a shared (SAP LUW). These functions may not be restarted by the update
• Update with delayed start : Set this option for low priority ("V2") functions that run
in their own update transactions. These functions can be restarted by the update task in case of
• Collective Run : In addition to V1 and V2 function modules, there are also function
modules of the type collective run.These do not updated automatically contrary to the function
modules mentioned first but only when a special report (report RSM13005) triggers the update
(for example in background operation).Then all calls of the function module are collected,
summarized (see example) and updated at once. They are treated like V2 update modules.
• Function Modules, retrived on 26-Aug-14 from SAP Online help URL
• How many types of function modules are there, retrived on 26-Aug-14 from SCN, URL
• Database Logical Unit of Work (LUW) ,reterived on 26-Aug-14, from SAP Help from SCN,
• Note 140357 - MCE_STATISTICS_UPD_V3, MCEX_UPDATE_02:COLL.RUN INIT,
reterived on 26-Aug-14, from SAP Techno,URL http://www.stechno.net/sap-notes.
• SAP Training videos by Peter Moxon, URL http://www.youtube.com/user/pcmoxon