cancel
Showing results for 
Search instead for 
Did you mean: 

SAP connector for Microsoft.NET

Former Member
0 Kudos

Hi,

I am using Microsoft Visual Studio 2003.

I need to connect SAP through .NET.

I am referring following link to do this.

http://help.sap.com/saphelp_nw2004s/helpdata/en/52/d2923e5b906663e10000000a114084/frameset.htm

http://www.codeproject.com/useritems/SAP_connector_for_NET.asp

But still I am unable to get data in data grid. data grid Only shows the column names.

I have called the required BAPI before binding it to the data grid, but still data is not displaying in the same.

Reference code is:

private void Button1_Click(object sender, System.EventArgs e)

{

SAPProxy3 proxy = new SAPProxy3();

try

{

proxy.Connection = SAP.Connector.SAPLoginProvider.GetSAPConnection(this);

// Call methods here

BAPIRETURN objBAPIRETURN=new BAPIRETURN();

proxy.Bapi_Salesorder_Getlist("0000000006","0001","","","","","","",out objBAPIRETURN,ref this.bapiordersTable1);

// Now update Data Bindings. On WinForms this will be automatic, on WebForms call the following line

this.DataGrid1.DataBind();

}

catch(Exception ex)

{

}

}

Thanks,

Sunil Pawar

Message was edited by:

Sunil Pawar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sunil,

What is the error ? Have you tried catching the exception and finding out if any exception does occur ?

If you are able to see the BAPI/RFC list in server explorer window and able to create the proxy, then I am sure there is no connection related issue.

You can do the following in order to find out why there is no data being returned-

1. Try login directly using SAP GUI and executing the BAPI with the same parameters. And see if it indeed returns some values.

2. OR you can set a external breakpoint in BAPI to track the execution and return values while invoking it from .NET client application.

Regards.

Former Member
0 Kudos

Hi Jitesh,

Thanks for your reply.

Let me tell you I have check data with SAP GUI and execute BAPI with sample parameters.It works well in SAP GUI.

But I think problem that i got here is might be because of not passing proper parameters.

If you check the signature of this BAPI (Salesorder_Getlist) you will get some idea to which parameters are required.

And important thing is that if I execute RFC that is RFC_CUSTOMER_GET then I got the result, only problem with Bapi_Salesorder_Getlist.

If u can help me on these it will be very nice of you.

Regards

Sunil Pawar

Former Member
0 Kudos

Hi Sunil,

Unfortunately I don't have installation of the required module for the BAPI you mentioned.

However I would still suggest you to do a external debugging to check what values you are sending, how the execution goes and what is the response.

Regards.

Former Member
0 Kudos

HI Sunil,

Check with the <b>'Destination'</b> properties where the proper server address, Host , message server are configured.That will solve your problem.

Regards

MohanaKrishnan.S