on 04-07-2009 2:26 PM
Dear Expert,
I am facing error ' Could not commit transaction' while entering Good Receipt PO . All GL account mapped.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.