Access SAP BAPI with .net

pts.
Tags:
SAP ABAP
VB.NET
By trying to access a BAPI we get an error after the line that starts with: ?error occurs in this statementa Maybe someone has a idea what is wrong in the statement. Peter using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace WebApplication1 { /// <summary> /// Summary description for WebForm1. /// </summary> public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.DataGrid DataGrid1; protected WebApplication1.BAPI7004_HTMLTable bapI7004_HTMLTable1; protected System.Web.UI.WebControls.TextBox txtName; protected System.Web.UI.WebControls.TextBox TxtToDate; protected System.Web.UI.WebControls.TextBox TxtFromDate; protected System.Web.UI.WebControls.Button Button2; protected WebApplication1.BAPI7004_RLTable bapI7004_RLTable1; protected System.Web.UI.WebControls.TextBox TxtReturn; protected System.Web.UI.WebControls.Button Button1; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.bapI7004_HTMLTable1 = new WebApplication1.BAPI7004_HTMLTable(); this.bapI7004_RLTable1 = new WebApplication1.BAPI7004_RLTable(); ((System.ComponentModel.ISupportInitialize)(this.bapI7004_HTMLTable1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bapI7004_RLTable1)).BeginInit(); this.DataGrid1.SelectedIndexChanged += new System.EventHandler(this.DataGrid1_SelectedIndexChanged); this.Button1.Click += new System.EventHandler(this.Button1_Click); this.Button2.Click += new System.EventHandler(this.Button2_Click); // // bapI7004_HTMLTable1 // this.bapI7004_HTMLTable1.AllowEdit = true; this.bapI7004_HTMLTable1.AllowNew = true; this.bapI7004_HTMLTable1.AllowRemove = true; this.bapI7004_HTMLTable1.SupportsChangeNotification = true; // // bapI7004_RLTable1 // this.bapI7004_RLTable1.AllowEdit = true; this.bapI7004_RLTable1.AllowNew = true; this.bapI7004_RLTable1.AllowRemove = true; this.bapI7004_RLTable1.SupportsChangeNotification = true; this.Load += new System.EventHandler(this.Page_Load); ((System.ComponentModel.ISupportInitialize)(this.bapI7004_HTMLTable1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bapI7004_RLTable1)).EndInit(); } #endregion private void Button1_Click(object sender, System.EventArgs e) { // Declare parameters here SAPProxy2 proxy = new SAPProxy2(); try { proxy.Connection = SAP.Connector.SAPLoginProvider.GetSAPConnection(this); // Call methods here ?error occurs in this statementa proxy.Bapi_Get_Payroll_Result_List("0008563", "20030901", "20030915", out WebApplication1.BAPIRETURN1 Return, ref WebApplication1.BAPI7004_RLTable Results); ? error stack f:inetpubwwwrootWebApplication1default.aspx.cs(87): ) expected f:inetpubwwwrootWebApplication1default.aspx.cs(87): ; expected f:inetpubwwwrootWebApplication1default.aspx.cs(87): ; expected f:inetpubwwwrootWebApplication1default.aspx.cs(87): ; expected f:inetpubwwwrootWebApplication1default.aspx.cs(87): ; expected f:inetpubwwwrootWebApplication1default.aspx.cs(87): Invalid expression term ')' f:inetpubwwwrootWebApplication1default.aspx.cs(87): Invalid expression term ',' f:inetpubwwwrootWebApplication1default.aspx.cs(87): Invalid expression term 'ref' a // Now update Data Bindings. On WinForms this will be automatic, on WebForms call the following line this.DataBind(); } catch(Exception ex) { // If SAPLoginProvider.GetSAPConnection(this) cannot get a connection, we might get an error. // Normally this can be ignored as it will automatically will force a relogon. } } private void Button2_Click(object sender, System.EventArgs e) { } private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e) { } } }

Answer Wiki

Thanks. We'll let you know when a new response is added.

Try using the Microsoft SAP .Net Connector at

http://www.microsoft-sap.com/net_connector.aspx

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following