Sei sulla pagina 1di 11

Logical Unit of Work(LUW)

and Function Modules in


SAP APAB
By:
Shiva Saxena
Developer
Maventic Innovative Solutions Pvt. Ltd.
Bangalore.

Mail: shivasaxena@outlook.com
Linkedin: https://www.linkedin.com/in/shivasaxena
Agenda

• Logical Unit • Types of


of Function • Conclusion
Work(LUW) Module & Credits

• Overview of • Update
Function Function
Module Module
Details
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
process).
• 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
the database.
• 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
library.

• Function Modules are of three types


• Normal
• Remote-enabled (RFC)
• Update
Workings of a function module

FM Memory

Function Groups :
Special ABAP Function Function
programs with type Group Group
F

Function Modules
Function Function Function
Module Module Module
Types of Function Module

Function Module

Remote Enabled UpdateModule :


Normal Module : Can be Function modules
Function called remotely are used to update
Module from an SAP or the database
non SAP System tables.
Update Function Module
• Using the function module in updating the database table helps
in updating without any irregularities as its transaction based.

Update
Function
Module

Update with Update with


Update with
immediate immediate Collective Run
delayed start
start 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
errors.

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

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

• 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.
• References
• Function Modules, retrived on 26-Aug-14 from SAP Online help URL
http://help.sap.com/saphelp_nw70/helpdata/EN/9f/db988735c111d1829f0000e829fbfe
/content.htm
• How many types of function modules are there, retrived on 26-Aug-14 from SCN, URL
http://scn.sap.com/thread/760507
• Database Logical Unit of Work (LUW) ,reterived on 26-Aug-14, from SAP Help from SCN,
URL
https://help.sap.com/saphelp_nw04/helpdata/en/41/7af4bca79e11d1950f0000e82de14a
/content.htm
• 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.html?view=sapnote&id=140357
• SAP Training videos by Peter Moxon, URL http://www.youtube.com/user/pcmoxon

Potrebbero piacerti anche