cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner's Guide to VB.net & SAP.connector

Former Member
0 Kudos

I am trying to find a complete start to finish example preferably in VB.net using the SAP connector that will access a file in SAP so I can understand what needs to be done and when.

So far, I have created a proxy in C# using an example I found and the wizard (I think it will work) but I haven't yet managed to get the VB.net program accepting it and doing anything with it. I cannot even get the sign on screen to appear.

All the code samples I have so far found have been in C# and most of those have assumed the proxy is already created. The program uses definitions that I then cannot find in the sample.

As someone who is just learning VB.net as well, it is very frustrating to get so close but not able to complete the task.

So if anyone has used VB.net to use this or could point me in the right direction, then I really would appreciate the help...

Many thanks in advance

Jim

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Have you seen the .SIM file for use with the SAP tutor...?

It takes you through one proxy class generation and showing the results in a datagrid... in C~# if I remeber but the concepts are the same...

Also have you got the .pdf with some examples ( downloaded with the connector.. )

regards

david_fryda2
Participant
0 Kudos

Hi,

I am starting programming VB .Net and C#...where Can I get examples on how using SAP Connectors ?

Thanx!

reiner_hille-doering
Active Contributor
0 Kudos

SAP .NET Connector comes with several samples. In 1.0 they are all C# (except one). In 2.0, all sample are available in both C# and VB.

Former Member
0 Kudos

1. Start Visual Studio.

2. Open an existing or create a new solution.

3. Add a new project and select C# project type.

4. Select "SAP.Connector class" template

5. Follow the instructions of the wizard

6. Build the project, you get a class library assembly, or a DLL

7. Add a new VB.NET project

8. Select Add Reference

9. Change to the Tab "Projects"

10. Select the C# project you built in step 6.

11. Use the proxy ...

Guangwei Li

Former Member
0 Kudos

Many thanks for the speedy reply, Guangwei

Your reply tied up the remaining loose ends with the proxy definition I already had i.e. setting the reference in the main project. But I am still having niggles with your Step 11 and actually getting the right code into the project to use the SAP connection.

I want the user to sign on to SAP where necessary and then choose a customer via the link to the Customer file as defined in the proxy setup. But it looks like I am missing something simple when creating the definitions in the VB as I haven't got it working yet. For example, I am trying to define proxy as "dim proxy as SAPProxyDLL1" but the message I am getting says SAPProxyDLL1 is an unknown type. So any further help would be even more appreciated.

Thanks

Jim

Former Member
0 Kudos

By the way, this is <i>not</i> for a web services program...

Jim

elko_hasse
Participant
0 Kudos

Hi,

with the .NET Connector comes a Documetation (in pdf format) that has in chapter 2.14 a small vb.net example.

In Short:

1. create a proxy object

2. establish a connection to the SAP system

3. call the RFC function module

<vb code>

'Define Object variable, SAPProxy is namespace and classname of the generated proxyclass

dim proxy As SAPProxy.SAPProxy

'Create proxy object

proxy = New SAPProxy.SAPProxy

'establish conntection to SAP using the SAPLogon Control (see toolbox: SAPLogonDestination)

proxy.Connection = New SAP.Connector.SAPConnection(Me.SapLogonDestination)

'Call the RFC, BrfcknA1Table1 is the generated SAPtable class (see toolbox: SAP Tabel Wizard)

proxy.Rfc_Customer_Get("", txtSearch.Text, BrfcknA1Table1)

</vb code>

Hope that helps.

elko

Former Member
0 Kudos

Hello,

Can you please find a VB.NET book and have a look at the topics like Namespace, Imports etc?

Regards,

Guangwei

elko_hasse
Participant
0 Kudos

Right, first you need to get familiar with VB.NET and then you can start learning .NET Connector.

elko