cancel
Showing results for 
Search instead for 
Did you mean: 

Error 'Could not commit transaction'

Former Member
0 Kudos

Dear Expert,

I am facing error ' Could not commit transaction' while entering Good Receipt PO . All GL account mapped.

Accepted Solutions (0)

Answers (2)

Answers (2)

sg2707
Participant
0 Kudos

I had a similar issue and below is what i found.

Symptom

The following error occurs when you do query to "select Top 1" in DI API.

"ERROR: System.Runtime.InteropServices.COMException (0xFFFFFBA4): Could not commit transaction:Error -1 detected during transaction en SAPbobsCOM.CompanyClass.EndTransaction(BoWfTransOpt endType)"

Reproducing the issue

Use the following sample code:

oCompany.StartTransaction()

Dim sql As String = "SELECT TOP 1 ""CardCode"" FROM ""OCRD"""

Dim rs As SAPbobsCOM.Recordset
rs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
rs.DoQuery(sql)

If rs.RecordCount > 0 Then
   rs.MoveFirst()
   While Not rs.EoF
      rs.MoveNext()
   End While
End If

If oCompany.InTransaction Then
   oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
End If

Actual Result:

ERROR: System.Runtime.InteropServices.COMException (0xFFFFFBA4): Could not commit transaction:Error -1 detected during transaction en SAPbobsCOM.CompanyClass.EndTransaction(BoWfTransOpt endType)

Expected Result:

No errors and successful commit

Cause

Application Error

Workaround:

The issue occurs when you use TOP 1 (when there is only one row). MoveFirst() and MoveNext() is not required when record count = 1.

Use the following logic to avoid errors:

If rs.RecordCount > 1 Then
   rs.MoveFirst()
   While Not rs.EoF
      rs.MoveNext()
   End While
End If

Former Member
0 Kudos

Could not commit transaction is not a normal error message. It is a database level error. Do you have SP for Good Receipt PO? If you have, disable it first.

Thanks,

Gordon

gagan_thareja
Participant
0 Kudos

Hi,

Please check for the Approval procedures and see if the user for which

you are getting error is defined the originator for the affected

documents.

You can check this by going through all the Approval template for that

particular document.

Then check the Terms tab of that template and if in Launch Approval

Procedure "When the following applies" is ticked then check the "Ratio"

column and "Value" column and make sure that some value is given there.

There should not be any undefined type.

If there is any Template which has undefined type selected then please

logged in as the Authoriser or Approver of that template and modify

that term.

Check all the approval template and go through the term tab and see the

value defined there.

Hope this will help.

Regards,

Gagan Thareja

SAP Business One Forums Team