Application Development 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: 

relation for calltrans and commit work

Former Member
0 Kudos

hi gurus

can any body say how the call transaction and commit work are related.

with regards

aru.

6 REPLIES 6

former_member223537
Active Contributor
0 Kudos

Hi,

After the Call transaction, to be on safer side you need to COMMIT WORK. Other wise if any error occurs, there are chance of the changes being Rolled back.

Best regards,

Prashant

Former Member
0 Kudos

Hi Aravind,

its depend on the called transaction. It is not required for every CALL TRANSACTION. if the transaction is doing some DB update then it is safe to add COMMIT WORK after CALL TRANSACTION is successful.

Regards,

Atish

Former Member
0 Kudos

hi,

After calling the transaction u need to do COMMIT WORK or else if an error occurs it will get rolled back.

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.

former_member193831
Active Participant
0 Kudos

hi,

"CALL transaction" is used to call a transaction from a program. You may or may not use call transaction depending on:-

If the user is supposed to do some action then a COMMIT WORK will be executed by the program of that transaction.

Let me knwow if you have a situation or scenario about this. Or please explain if I have not understood the question.

Vivek

0 Kudos

Hi,

CALL TRANSACTION stats a new SAP LUW, and the current LUW is kept as it is, so if you want your current SAP LUW to be saved before you leave to another SAP LUW so that failure of the new SAP LUW does not have any effect then use COMMIT WORK which closes or say saves the current SAP LUW by causing a Database commit and closing the Database LUW.

Regards,

Sesh

Former Member
0 Kudos

Hi,

Executes a database commit and thus closes a Logical Unit of Work ( LUW) (see also Transaction Processing). This means that

all database updates 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,

closes all open database cursors (see OPEN CURSOR) and

resets the time slice counter to 0.

Never Use Commit work in a select... endselect .. program dumps..

<b>Reward points</b>

Regards