‎2007 Nov 12 8:11 AM
Hi Experts
How and where to use LUW in Dialog programming, pls give me the step by step procedure and example about LUWalso.
How to know whether LUW is used in a particular program.
thanks in advance.
Regards
Rajaram
‎2007 Nov 12 8:16 AM
Hello,
http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/content.htm
A Logical Unit of Work (LUW or database transaction) is an inseparable sequence of database operations which must be executed either in its entirety or not at all. For the database system, it thus constitutes a unit.
LUWs help to guarantee database integrity. When an LUW has been successfully concluded, the database is once again in a correct state. If, however, an error occurs within an LUW, all database changes made since the beginning of the LUW are canceled and the database is then in the same state as before the LUW started.
An LUW begins
o each time you start a transaction
o when the database changes of the previous LUW have been confirmed (database
commit) or
o when the database changes of the previous LUW have been cancelled (database rollback)
An LUW ends
o when the database changes have been confirmed (database commit) or
o when the database changes have been canceled (database rollback)
COMMIT WORK.
Executes a database commit and thus closes a logical processing unit or Logical Unit of Work ( LUW ) (see also Transaction processing ). This means that
all database changes are made irrevocable and cannot be reversed with ROLLBACK WORK and
all database locks are released.
COMMIT WORK also
calls the subroutines specified by PERFORM ... ON COMMIT * executes asynchronously any update requests (see CALL FUNCTION ... IN UPDATE TASK ) specified in these subroutines or started just before,
processes the function modules specified in CALL FUNCTION ... IN BACKGROUND TASK ,
cancels all existing locks (see SAP locking concept ) if no update requests exist,
closes all open database cursors (see OPEN CURSOR ) and
resets the time slice counter to 0.
COMMIT WORK belongs to the Open SQL command set.
Return code value
The SY-SUBRC is set to 0.
ROLLBACK WORK.
Closes a logical processing unit by reversing all database changes made since the last COMMIT .
You use this statement if you cannot be certain that all the database changes have been executed correctly.
The update routines are not performed.
ROLLBACK WORK belongs to the Open SQL command set.
Note
If the ROLLBACK statement occurs within a SELECT loop, the processing cannot continue because the database cursor is invalid. After the ROLLBACK statement, you should therefore ensure that all SELECT processing has been explicitly terminated.
With Regards,
Vidya
‎2007 Nov 12 8:17 AM
Hi
A Logical Unit of Work (LUW or database transaction) is an inseparable sequence of database operations which must be executed either in its entirety or not at all. For the database system, it thus constitutes a unit.
LUWs help to guarantee database integrity. When an LUW has been successfully concluded, the database is once again in a correct state. If, however, an error occurs within an LUW, all database changes made since the beginning of the LUW are canceled and the database is then in the same state as before the LUW started.
An LUW begins
o each time you start a transaction
o when the database changes of the previous LUW have been confirmed (database commit) or
o when the database changes of the previous LUW have been cancelled (database rollback)
An LUW ends
o when the database changes have been confirmed (database commit) or
o when the database changes have been canceled (database rollback)
SAP memory and ABAP memoryUsing SAP memory. User-specific memory retained for the duration of the session. Can only be used for simple field values.
Using ABAP memory. Can be used to transfer data between internal modi. Can be used to transfer any ABAP/4 variables ( Fields, strings, internal tables, complex objects)
SAP memoryYou use the SPA/GPA parameters to pass data. These paramters are saved globally in memory. The paramters are indetified by a three-character code.
In dialog programs you can SET and GET these parameters in the attribute window of the screen field, by marking the SET and GET fields and put the name of the parameter in the ParameterId field.
In a program ( Dialog or Report ) you can use the GET PARAMETER and SET PARAMETER statements:
set parameter id 'RV1' field <fieldname>
get parameter id 'RV1' field <fieldname>