‎2006 Nov 22 7:18 AM
Hi all
I want to know about the perform statement with commit
is there any satement like perform on commit
then what does it do.
can any one explain with example .
Thanks and regards.
kiran.
‎2006 Nov 22 7:24 AM
you can create a function module and call it in UPDATE TASK,
which means this FM will be called when COMMIT happens.
‎2006 Nov 22 7:26 AM
Hi,
Learn more about update techniques:
http://help.sap.com/saphelp_erp2004/helpdata/en/41/7af4cba79e11d1950f0000e82de14a/content.htm
'Perform subroutine ON COMMIT' will be executed when 'COMMIT WORK' is triggered.
‎2006 Nov 22 8:09 AM
Hi Kiran,
perform <subroutine> on commit.
Calls the specified subroutine at the next COMMIT WORK statement. This allows you to delay the subroutine until the logical transaction is finished. Even if you register the same subroutine more than once, it is only executed once. The ROLLBACK WORK statement deregisters all subroutines registered using this addition.
Notes
You cannot use USING or CHANGING with the ... ON COMMIT addition. If you need to pass data to the subroutine, you must place it in global variables or use the EXPORT ... TO MEMORYstatement.
The PERFORM ... ON COMMIT statement can also be used during update. The corresponding subroutine is called at the end of the update task.
Hope this helps.
Regards,
Kinshuk
‎2006 Nov 22 8:14 AM
HI,
There is one more statement which does the job of PERFORM ON COMMIT.
That is CALL FUNCTION IN UPDATE TASK. This is used the call the funtion modules.
When you say PERFORM ON COMMIT all these routines will be execued in the same LUW (Logical Unit of Work)on COMMIT WORK and also you have to use global data.
When you use UPDATE TASK all the Function modules will be called in a different LUW than the LUW of the calling program. And you can pass data to the function module using the FM interface. All FM's will be executed on COMMIT WORK.
Also if you call PERFORM F1 ON COMMIT 5 times in your code this F1 routine will be executed only once on COMMIT WORK not 5 times.
Regards,
Sesh
‎2006 Nov 28 10:29 PM
HI,
In everyday language, a transaction is a sequence of actions that logically belong together in a business sense and that either procure or process data. It covers a self-contained procedure, for example, generating a list of customers, creating a flight booking, or sending reminders to customers. From the users viewpoint, it forms a logical unit.
The completeness and correctness of data must be assured within this unit. In the middle of a transaction, the data will usually be inconsistent. For example, when you transfer an amount in financial accounting, this must first be deducted from one account before being credited to another. In between the two postings, the data is inconsistent, since the amount that you are posting does not exist in either account. It is essential for application programmers to know that their data is consistent at the end of the transaction. If an error occurs, it must be possible to undo the changes made within a logical process.
In the R/3 System, there are three terms frequently used in this context:
Database Logical Unit of Work (LUW)
A database LUW is the mechanism used by the database to ensure that its data is always consistent.
SAP LUW
An SAP LUW is a logical unit consisting of dialog steps, whose changes are written to the database in a single database LUW.
SAP Transaction
An SAP transaction is an application program that you start using a transaction code. It may contain one or more SAP LUWs.
Click the below links to know LUW
DB LUW
http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4bca79e11d1950f0000e82de14a/content.htm
SAP LUW
http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/content.htm
SAP TRansactions
http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4c2a79e11d1950f0000e82de14a/content.htm
Update Techniques
The main update technique for bundling database changes in a single database LUW is to use CALL FUNCTION... IN UPDATE TASK. This section describes various ways of updating the database.
A program can send an update request using COMMIT WORK
To the update work process, where it is processed asynchronously. The program does not wait for the work process to finish the update ( Asynchronous Update).
For asynchronous processing in two steps ( Updating Asynchronously in Steps.)
To the update work process, where it is processed synchronously. The program waits for the work process to finish the update ( Synchronous Update).
To its own work process locally. In this case, of course, the program has to wait until the update is finished ( Local Update.)
<b>PERFORM ON COMMIT</b> is one such update technique.
Click the link below to know more about Perform on commit.
http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4d4a79e11d1950f0000e82de14a/content.htm
Regards,
Vara