cancel
Showing results for 
Search instead for 
Did you mean: 

problem for Bapi_transaction_commit

Former Member
0 Kudos

Hi all,

I am creating a sales order using bapi Bapi_Salesorder_Createfromdat2 in vb.

I know that I should also call Bapi_transaction_commit after calling Bapi_Salesorder_Createfromdat2.

But the vb returns an error:

An unhandled exception of type 'System.InvalidOperationException' occurred in system.web.services.dll

Additional information: Method SAPProxy1.Bapi_Salesorder_Createfromdat2 can not be reflected.

It works fine (with sales order no. generated but not wrote to database) if I don't call the Bapi_transaction_commit. but it gives error once I use it. What's wrong or any missing steps that I should do?

Thanks.

p.s and it returns error after running line 2 in the SAPProxy1.vb:

Line1: Public Sub New(ByVal ConnectionString As String)

Line2: MyBase.New(ConnectionString)

Line3: End Sub

Message was edited by: Macy Lo

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

Please remove Bapi_transaction_commit from your proxy and use the builtin CommitWork method instead.

Former Member
0 Kudos

Hi ,

It works if I use the CommitWork method. But it seems that it can't handle the synchronization problem.

As the standard bapi Bapi_transaction_commit allows us to specify the wait parameter, but I just can't use it, it gives error:

The XML element named 'RETURN' from namespace '' references distinct types SAP.Connector.BAPIRET2 and SAP.Connector.BAPIRET2Table. Use XML attributes to specify another XML name or namespace for the element or types.

What could I do ? thanks.

reiner_hille-doering
Active Contributor
0 Kudos

The "Wait" parameter is intentionally removed from the builtin CommitWork, because it can cause serious dead-locks on server side. If you are sure that you still want to use it, you can work arround the "reflection" issue. Please search the forum - there have been several threads.