Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

dailog programing

Former Member
0 Likes
416

hi,

what is the use of perform on commit and roolback..

how we can use in programning

3 REPLIES 3
Read only

Former Member
0 Likes
389

In a COMMIT, all the changes made by a transaction or a subtransaction on the database instance are recorded.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a COMMIT, a new transaction is implicitly opened.

In normal database operation, the database system performs the required COMMIT actions independently. However, COMMIT can also be explicitly requested using appropriate SQL statements.

In a ROLLBACK, all the changes made by a transaction or a subtransaction on the database instance are reversed.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a ROLLBACK, a new transaction is implicitly opened.

In normal database operation, the database system performs the required ROLLBACK actions independently. However, ROLLBACK can also be explicitly requested using appropriate SQL statements.

Read only

Former Member
0 Likes
389

If you want to fire a PERFORM upon a commit / rollback event, that is when you would use the same.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
389

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 user’s 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 more on 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.)

PERFORM ON COMMIT is one such Update Commit.

Click the below link to more about PERFORM on Commit.

http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4e3a79e11d1950f0000e82de14a/content.htm

Synchronous Update

In synchronous update, you do not submit an update request using CALL FUNCTION... IN UPDATE TASK. Instead, you use the ABAP statement COMMIT WORK AND WAIT. When the update is finished, control passes back to the program. Synchronous update works in the same way as bundling update requests in a subroutine (PERFORM ON COMMIT). This kind of update is useful when you want to use both asynchronous and synchronous processing without having to program the bundles in two separate ways. The following diagram illustrates the synchronous update process:

Use this type of update whenever the changed data is required immediately. For example, you may want to link SAP LUWs together where one LUW depends on the results of the previous one.

ROLLBACK.

Rollback is a procedure to call off the database updates. If there is any error, the the updates can be called off before commiting.

I hope your questions are answered.

Regards,

Vara