VB.Net and SAP RFC/RFM

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Does anyone have any information/site/examples regarding connecting to
SAP and
getting date via an RFC call using VB.net? I've managed to get it to
log into SAP but am now a bit stuck. The examples are all c#
which is fine if you program in c# but not very useful if you're not
:-(

Thanks in advance for any help
Dan
 
Hi Rob,
I was trying to use the .net connector. I successfully followed the
instructions for creating a C# SAP Proxy class. No problems there. I
am just getting stuck in the VB side of things, there doesn't appear
to any way of giving the (e.g) sapProxyDll1 object a SAPconnection
object or executing the Proxy.

Cheers
Dan
 
The proxy assembly should contain proxy classes. Are you sure sapProxyDll1
is the class name, and not the assembly name? Check the Object Viewer to
make sure.
Once you have the class name (SAPProxy1 for example), then you can use the
following code:

Dim sp As New SAPProxy1("connection string goes here")
sp.Connection.Open( )

At this point, sp should allow you to call all the remote functions you
added in the proxy builder.
Don't forget to call sp.Connection.Close( ) when you are done.

-Rob Teixeira [MVP]
 
THere are samples in the directory that the .net connector installs. Use
this as your template. Make sure to look at the winform project for
RFC_CUSTOMER_GET. Start that one, and go to the connection form (via menu
or something, can't remember). It will produce a connection string at the
bottom. Use that same string (with your R/3 values) for the connection
string in your own project.
 
Back
Top