Skip to Content
0
Former Member
Aug 01, 2005 at 11:58 AM

External device connection: RFC Server?

56 Views

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