SAP RFC SDK

Question: Backgroud: I want to call from ABAP (using RFC) a VisualBasic function, to transfer data to an external system (written in VB).

I created a server program (in Visual Basic), that registers at SAP-Gateway and waits for RFC calls from ABAP. I use the RFCSDK from SAP (librfc32.dll).

I use the following function from the DLL:
> RfcAcceptExt (Logon to the SAP-Gateway with connection data from saprfc.ini)
> RfcDispatch (Wait for a RFC Request and call the registered Function)
> RfInstallFunctionExt (Register the callable function(s))

The SAP documentation only has examples for C programming language and the generated VB programs in SE37 wont help, so here my question:

How do I use the DLL function "RfcInstallFunctionExt" correctly in Visual Basic?


Please help !

Answer:
To set the Functionpointer in RfcInstallFunction use the Visual Basic Operand "AddressOf".

Regards
Gast

Answer:
Hi,

I don't have the answer to your original question; but from
your requirement, you might consider another solution -
SAP COM4ABAP Service.

You implement your function in a Microsoft COM object
and expose it as a COM Method. Then you configure
SAP COM4ABAP Service which will include a mapping
of I/O params between COM & ABAP and serves as
a RFC Server listener by registering itself as a
Registered Program to your R/3. When your
ABAP code calls the external function, SAP
COM4ABAP will relay the call to your COM
method, get the job done and return whatever
it gets. From the ABAP side, you just call
a Function Module with a Destination and don't
even know that it's actually been done in a COM.

You may get related doc and sample by installing
SAP DCOM Connector.

Things to note are :

1. You may need to import a few extra function
modules into your existing R/3, if its Basis version
is below 46D. The transport files are included with
SAP DCOM Connector installation.

2. Every time you rebuild your COM object, remember
to reconfigure your COM4ABAP mappings becoz the
UUID for COM is enbed in the mappings (stored in
a local XML file). The UUID is changed everytime
when COM is rebuilt and registered to your system
so you need to make sure the XML mapping always
contain the updated UUID to make the invocation
successful.

Hope this helps ...

- YJChen
Copyright ?2007 - 2008 www.jt77.com