Saturday 15 March 2014

LUW : DB Luw & SAP Luw

----------------------------------------------------------------------------------------------------------------------------
Scenario: Suppose a transaction involves multiple screens. We can say that the  Transaction is successful if all the data involved in multiple screens are properly updated in the data base tables else the Transaction is unsuccessful.

For this case the Developer Can proceed with two ways:
Meth-1. While navigating from one screen(Source Screen) to another screen(Target Screen), just before navigation, Update the data base tables(DB Commit) for that particular source screen.
So this method involves Database Updates for each individual screen.

Meth-2. While navigating from one screen(Source Screen) to another screen(Target Screen), collect the required data in some internal tables for each individual screen and at the end of the last screen of the transaction, update the database with all the relevant data from multiple screens of the transaction .

In method-1, The Transaction is successful if each  DB commit of Individual screen is successful.
But many times this is not the case. What if the DB commit is successful for the first screen of the transaction but DB commit fails for the subsequent screens of the Transaction. In total  the Transaction is failed but some of the database update is committed leads to data inconsistencies.

To over come this problem, the method 2 approach is adapted. Which ensures that  all the data is either fully committed or else everything is rolled back.

DB Luw: The DB Luw happens for each individual screen.
SAP Luw: The SAP Luw combines all DB Luw's of the  Transaction into a Single LUW.

To implement Method-2 (SAP LUW), either we have to use Update Function  Module or Subroutine : Perform XXXXXX on Commit technique.











_________________________________________________________________________________




No comments:

Comments system

Disqus Shortname