cancel
Showing results for 
Search instead for 
Did you mean: 

Load a SAP table in a datagrid in C# ,net

Former Member
0 Kudos

I am a beginner using the SAP .Net Connector 2.0 Could somebody help me with a user guide for a very beginner? Or if possible please tell me step by step how can I connect my application to a SAP table. I know the name of the table and the fields in SAP. I dont know anything about how to connect my application with the SAP. I have already installed the .Net connector 2.0, please may somebody help me?

I am working with VS .Net 2003

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Create a “Windows Forms” application.

Add an empty SAP Connection class with the ABAP functions

RFC_CUSTOMER_GET and RFC_CUSTOMER_UPDATE.

Leave the proxy designer open. Go to the SAP Proxy toolbox and drag the “Proxy field” icon to the designer.

Rename the new “Field1” to “Tab”. Change the “Type” property to BRFCKNA1Table. To do this, use the drop down icon.

Note that the ReadOnly property automatically changes to ”true” and the default value changes to “new BRFCKNA1Table()”.

Add a second Proxy Field with the name “Filter”, the type “String” and the default value “A*”.

Select the “Rfc_Customer_Get” function and click on the “…” button of the “Parameters” property.

Set the default values of the three parameters with the drop-down icon as follows:

Name1: Filter

Kunnr: “” Customer_T: _Tab

Save the proxy designer and switch to your Windows form. Add a TextBox, a Button and a DataGrid.

Add an instance of your SAP proxy to your Windows form, add a “Destination” and set the “Connection” property as described in “A4”.

Set the DataSource property of the datagrid to “sapProxy11”. Set the DataMember property of the datagrid to “Tab”. Alternatively you can set the DataSource to “sapProxy11.Tab” and leave the DataMember empty.

For “textBox1” use the DataBinding feature to bind the “Text property” of the textbox to “sapProxy11.Filter”.

Double-click the button to create an event handler and add a single line:

“this.sapProxy11.Rfc_Customer_Get_();”

You are using “sapProxy11” as a smart DataSet that contains the necessary state. You bind the state to the corresponding controls. The overload method Rfc_Customer_Get_() does not have any parameters, as the required state is already in the bound Proxy Fields.

above statments from standard helpfile,and

in my opinion you need

datagrid1.datasource = yourtable

Former Member
0 Kudos

Hello I have some question, recall, this is the first time I use the SAP .Net connector.

The only item I can add is a "SAP Connection proxy" is this what you name SAP Connection class?.

Where can I see this RFC_CUSTOMER_GET and RFC_CUSTOMER_UPDATE?

How may I do this?

reiner_hille-doering
Active Contributor
0 Kudos

It seems that you are looking into documentation of .NET Connector 1.x. The documenation for version 2.x (the one you are using) is contained as Visual Studio online help - including some tutorials.

Former Member
0 Kudos

Actually the examples included with NCo 2.0 still contain sample projects that reference these nonexistent functions.

Former Member
0 Kudos

after adding the data source add another line for data binding :

datagrid1.datasource = yourtable ;

DataGrid1.DataBind();

Thanks

Rajesh

Former Member
0 Kudos

Hi Folks,

I am ABAP developer who is new to the .NET Connector.

Using the .Net Connector Help documentation, I successful developed a sample web forms application in VS 2003 which connects to my SAP system (via a bapi) and displays the results in a datagrid.

My client has a separate team of C developers that want to use my sample application as a base to build a full C application (in VS 2003). They do not have .NET Connector installed on their system. And they don't care to have the result displayed on a webform. Is it possible for them to 'import' my sample application into their VS 2003 (despite not having NCo installed) and proceed with their development in design mode? Will the sapproxy objects still work for them? What if I create my proxies as standalone proxies? Will this allow them to import my project and continue with their development?

Thanks,

Irine

Message was edited by: Irine Alexander

reiner_hille-doering
Active Contributor
0 Kudos

The .NET Connector (NCo) is for the .NET framework (as the name says). There are a couple of programming languages, like C# and VB that compile to this framework. There is also a flavor of C++ (so called managed C++ or C++/CLR) that compiles to .NET. This could be used with NCo.

However, pure (unmanged) C or C++ doesn't run on the .NET framework. Using .NET Connector proxies from umanaged C/C++ is threoretically possible, but complicated (e.g. using a COM object wrapper).

For "real hardcore" C developers SAP provides the RFC SDK, which comes with SAPGUI (e.g. in "C:\Program Files\SAP\FrontEnd\SAPgui\rfcsdk"). Unfortunately the use of the RFC SDK is a bit more complicated than NCo.