cancel
Showing results for 
Search instead for 
Did you mean: 

error while calling BAPI_TRANSACTION_COMMIT in SAP .Net Connector

Former Member
0 Kudos

Hi Experts,

I am using Visual Studio 2003 and SAP.Net Connector for Microsoft .NET 2.0.

I am creating sales order from web application but when I am calling BAPI for commit .....

proxy.Bapi_Transaction_Commit("X",out bapiReturn2);

It throws me an error like below.

The XML element named 'BAPI_TRANSACTION_COMMIT' from namespace 'urn:sap-com:document:sap:rfc:functions' references a method and a type.

Change the method's message name using WebMethodAttribute

or change the type's root element using the XmlRootAttribute.

Does any one have idea how to deal with this problem

Thanks in Advanced

Sunil Pawar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Sunil,

You should consider creating a wrapper that includes the BAPI you want to execute along with the COMMIT. That way you only have to make one call to SAP.

Former Member
0 Kudos

I solved this problem by adding following line of code instead of giving separate call to BAPI_TRANSACTION_COMMIT.

SAPProxy1 BAPI = new SAPProxy1(conStr);

BAPI.Bapi_Salesorder_Createfromdat2(list of parameters)

BAPI.CommitWork();

Now its working.If any one needed more information on this give reply to this post

Former Member
0 Kudos

Hi Sunhil I was having the same problem and I tried to correct it the same way you have here albeit for bapi_Salesdocument_Copy.

The trouble was it would return no document because the BAPI dows not work on its own even nativly in SAP. S by the time I got to the proxy.bapi_transaction_commit() line of code it was to late. The statelessness of the bapi seems to be the problem. Any thoughts?

Thanks,

Mark