Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

External device connection: RFC Server?

Former Member
0 Kudos
228

Hello to all,

i'm new here.

I'm facing a new problem i never met before.

I'm on a 4.7 enviroment and i have to interface sap with an external device.

The producers of external device, release an executable file that makes (but i don't kwnow how) the communication from the device and sap.

The only things that i had to do was (following the device documentation):

1. Create a tcp/ip remote destination that point to one external executable (es: Z_EXT_DEVICE --> c:\device\device2sap.exe) (if i double-click on it, it don't do anything)

2. Setup in the external setup device program (setupdevice.exe), the name of the RFC destination (Z_EXT_DEVICE), the sapgateway address (sapgw00) and the sap host address (ex 10.2.4.XX)

(Note that i don't have to specify sap usr/pwd for the connection in any step).

3. Call a simple function module in SAP system in this way:

CALL FUNCTION 'Z_RFC_DATA' DESTINATION 'Z_EXT_DEVICE'

EXPORTING

header = szheader

data = szdata

status = '0'

data_len = szvalue

IMPORTING

system = szretsystem

code = szretcode

ret_text = szrettext

header = szanswerheader

len_data = szlendata

bct_status = szstatus

bct_data = szanswerdata

EXCEPTIONS

communication_failure = 1

system_failure = 2

OTHERS = 3.

The code of the function module is empty :

FUNCTION Z_RFC_BCT.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(HEADER) LIKE BAPIRET2-MESSAGE

*" VALUE(DATA) LIKE BAPIRET2-MESSAGE

*" VALUE(STATUS) LIKE BAPIRET2-MESSAGE

*" VALUE(DATA_LEN) LIKE BAPIRET2-MESSAGE

*" EXPORTING

*" VALUE(SYSTEM) LIKE BAPIRET2-MESSAGE

*" VALUE(CODE) LIKE BAPIRET2-MESSAGE

*" VALUE(RET_TEXT) LIKE BAPIRET2-MESSAGE

*" VALUE(HEADER) LIKE BAPIRET2-MESSAGE

*" VALUE(DATA) LIKE BAPIRET2-MESSAGE

*" VALUE(LEN_DATA) LIKE BAPIRET2-MESSAGE

*" VALUE(STATUS) LIKE BAPIRET2-MESSAGE

*" EXCEPTIONS

*" COMMUNICATION_FAILURE

*" SYSTEM_FAILURE

*"----


ENDFUNCTION.

After the call of the function module in sap system, magically the importing variables are filled all by values read from the external device. At this point I'd like to ask u some questions :

1. I think that external device program (device2sap.exe) is an RFC server program. Is it right ??

2. How the connection from external executable and sap works if i don't specify usr/pwd in any configuration file? The device infact, work with every sap (if u execute the three sinple step wrote before)

3. I'd like write a server like that for a different external device. In the old release of sap (4.0,4.5) there was a sap tools (in function module editor SE37) that permitted (starting from a function module), to generate a client or server external program (in C or VB). In 4.7 this functionality is missing. Is there other sap tools that permitt to do the same thing or this functionality is completly lost?? In the second case, do u have some hits that could help me in this step??

4. I'd like to have some documentation about the server program and communication methos between external RFC server program and Sap. Where i can find some good documents that could help me in that task ??

5. I heard about DCOM connector. Where i can find some good documentations that explain how is it , how it works and if it could solve my problem ?

Thanks a lot in advance.

Andrea

1 REPLY 1

Former Member
0 Kudos
105

Hi, I'm sure the device2sap.exe is developed by a Connector Tools. E.G. .Net Connector, Jco and so on.

So reply your question as following:

1. Yes, in the external application side, it can simulate a RFC server for the SAP to call, just like call to another R3 server.

2. No need on use/pw. it is not DataBase connection, just a RFC connection. The key feature only need is the IP. And you should configure the RFC destination using IP. RFC is a FM call protocol, not to access a DB.

3. Using the Connector tools I mentioned in the former reply. And you can navigate in the .Net Tech Forum in SDN.

4. The guide of Connector Development can be get from SDN, and some sample code will be copy in the install directory, after you installed it.

5. DCOM is the tech used in the former Connector version SAP DCOM conncetor. Now, as the windows is into the Dotnet Time, recommand you to use DotNet Connector.

That's all. hope it will be helpful