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

COMMIT WORK

Former Member
0 Kudos
225

Hi ,

Can anyone of you explain the situations which cause the failure the COMMIT WORK command in SAP ?

Thanks in advance,

Regards,

Vara

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
199

It can be several reasons why a commit will fail, but most often it is because this command was issued in an update task. Apart from this reason, other reasons could be an extremely rare case of some system or memory crash.

Srinivas

7 REPLIES 7
Read only

Former Member
0 Kudos
199

The only runtime errors I have encountered is while using COMMIT WORK in CALL FUNCTION .. ON UPDATE TASK, we should not be using COMMIT work here.

Also, check the help documentation for COMMIT WORK.

Read only

0 Kudos
199

hi,

can i do this in my custom transaction.

call function z_bapi-sales_ord_change in update task

....

....

call function bapi_transcation_commit.

Read only

0 Kudos
199

If the program flow is as described by you, yes you can. But if the BAPI_TRANSACTION_COMMIT call is within the Z_BAPI_SALES_ORD_CHANGE, then it will dump.

What you have to remember is, all the database updates that are in UPDATE task will be transferred to the database after you issue the COMMIT WORK or it is implicitly issued by the system like when you leave the transaction in a normal way.

Srinivas

Read only

0 Kudos
199

hi

thanks for ur quick reply..

i tried commenting out the commit

call function 'ZBAPI_SALESORDER_CHANGE' in update task

exporting

salesdocument = ord_num

order_header_in = header

order_header_inx = headerx

tables

return = t_return

partnerchanges = update_so_partners

partneraddresses = update_so_addr.

  • call function 'BAPI_TRANSACTION_COMMIT'

and the result is there was no update to the tables.

does that mean tha the system did not issue an implicit commit work after i leave my transcation..

thanks..

Read only

Former Member
0 Kudos
200

It can be several reasons why a commit will fail, but most often it is because this command was issued in an update task. Apart from this reason, other reasons could be an extremely rare case of some system or memory crash.

Srinivas

Read only

0 Kudos
199

Another reason that I encountered most often was if the tablespace is full. This has happened at our site, a couple of times, when the the database alerts set by the database administrators failed to intimate them automatically when the tables were filling up. So the commits failed because there was not enough space to store the records. This is also very extreme, but with fast growing tables such as MSEG or BSEG, it is very much possible if proper notification process is not in place.

Srinivas

Read only

Former Member
0 Kudos
199

I'm not sure if this answers your question, but even though a transaction issues a commit and the commit is successful, the update may still fail. You can use SM13 to find out if this has happened. (Click on 'terminated'.)

Rob