on 07-06-2004 2:38 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.