cancel
Showing results for 
Search instead for 
Did you mean: 

How to call Bapi_Transaction_Commit in .NET?

Former Member
0 Kudos

I am new in sap.net connector.

I installed Microsoft Visual Studio .Net 2003 Professional, SAP.Net Connector 2.0 in Windows Server 2003.

I am doing a program to create DO in SAP from .net.

Firstly,

Bapi.Bapi_Deliveryprocessing_Exec(a, b, c, d, f, g, h, i, j, k, l, m, n, o, p, q, r)

Then,

Bapi.Bapi_Transaction_Commit("X", bb)

But, I always hit error.

Do I need to call Bapi.Bapi_Transaction_Commit("X", bb)?

I try to call Bapi.commitwork(), but there is nothing return to me.

Can anyone please help?

Error are as below:

Server Error in '/WebApplication1e' Application.

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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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.

Source Error:

Line 41: '@ <param name="connectionString">A connection string (e.g. RFC or URL) specifying the system where the proxy should connect to.</param>Line 42: Public Sub New(ByVal ConnectionString As String) Line 43: MyBase.New(ConnectionString)Line 44: End SubLine 45:

Source File: c:\inetpub\wwwroot\WebApplication1e\SAPProxy2.vb Line: 43

Stack Trace:

[InvalidOperationException: 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.] System.Xml.Serialization.XmlReflectionImporter.ReconcileAccessor(ElementAccessor accessor) System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(String elementName, String ns, XmlReflectionMember[] members, Boolean hasWrapperElement) System.Web.Services.Protocols.SoapReflector.ImportMembersMapping(XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, Boolean serviceDefaultIsEncoded, Boolean rpc, SoapBindingUse use, SoapParameterStyle paramStyle, String elementName, String elementNamespace, Boolean nsIsDefault, XmlReflectionMember[] members, Boolean validate, String key) System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs)[InvalidOperationException: Method SAPClient.CommitWork can not be reflected.] System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) System.Web.Services.Protocols.SoapClientType.GenerateXmlMappings(Type type, ArrayList soapMethodList, String serviceNamespace, Boolean serviceDefaultIsEncoded, ArrayList mappings) System.Web.Services.Protocols.SoapClientType..ctor(Type type) System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() SAP.Connector.SAPClient..ctor(String connectionString) WebApplication1e.SAPProxy2..ctor(String ConnectionString) in c:\inetpub\wwwroot\WebApplication1e\SAPProxy2.vb:43 WebApplication1e.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication1e\WebForm1.aspx.vb:38 System.Web.UI.WebControls.Button.OnClick(EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain()

Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

BAPI_TRANSACTION_COMMIT doesn't have two import parameter, please check

Former Member
0 Kudos

Please apply SAP notes.

There is a DesignPatch_22.zip