Application Development and Automation 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: 
Read only

Sending data from one sserver to another using RFC

Former Member
0 Likes
2,933

Hi,

I have a requirement to send data from one server to another using RFC.

Can anyboduy guide me what coading to be incorporated in sending function module and receving function module(Beside fetching data from database and updating data at receving databse and clicking RFC function module radio button).

Also what additional configuration is required(Just the way we configure partner profile and distribution model to connect two serveres in case of ALE)?

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,807

Hello Sanjay,

As long as you have configured your RFC destinations correctly in SM59, you dont have any other system configurations to worry about to execute an RFC call. In SM59, you create an ABAP connection (assuming you are communicating between 2 SAP Servers). Provide the server info in the technical settings, Provide log on info in the logon tab (this can be a generic RFC id or the user's credentials). Test the RFC connection to make sure it works. If you are working with Unicode systems, you will have to provide the correct Unicode info in the Unicode/MDMP tab.

Your sending function module (Call function <NAME> Destination <DEST>) will be a skeleton FM in your sending system. You will only make sure that the correct FM interface parameters are passed in the sending system. After the RFC call, a work process will start in the receiving system with the local version of the RFC FM. The FM at the receiving end should contain the logic to update the respective Database based on the data (may be the internal table) passed by the calling system. You dont have to do anything special to read the data sent. The corresponding FM parameter is automatically populated.

Hope this helps.

Regards,

Jinesh.

Hi,

I have a requirement to send data from one server to another using RFC.

Can anyboduy guide me what coading to be incorporated in sending function module and receving function module(Beside fetching data from database and updating data at receving databse and clicking RFC function module radio button).

Also what additional configuration is required(Just the way we configure partner profile and distribution model to connect two serveres in case of ALE)?

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
1,808

Hello Sanjay,

As long as you have configured your RFC destinations correctly in SM59, you dont have any other system configurations to worry about to execute an RFC call. In SM59, you create an ABAP connection (assuming you are communicating between 2 SAP Servers). Provide the server info in the technical settings, Provide log on info in the logon tab (this can be a generic RFC id or the user's credentials). Test the RFC connection to make sure it works. If you are working with Unicode systems, you will have to provide the correct Unicode info in the Unicode/MDMP tab.

Your sending function module (Call function <NAME> Destination <DEST>) will be a skeleton FM in your sending system. You will only make sure that the correct FM interface parameters are passed in the sending system. After the RFC call, a work process will start in the receiving system with the local version of the RFC FM. The FM at the receiving end should contain the logic to update the respective Database based on the data (may be the internal table) passed by the calling system. You dont have to do anything special to read the data sent. The corresponding FM parameter is automatically populated.

Hope this helps.

Regards,

Jinesh.

Read only

0 Likes
1,807

Great help Jinesh.

I will be really thankuil if you can paste functio module schema.

Read only

0 Likes
1,807

Hi Sanjay,

There is no pre-defined schema for RFC FMs. You just have to maintain consistency in in the sending and receiving systems.

For example, in the sending system, the RFC defn. would be


function <FM_NAME>
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(USER) TYPE  USR02-BNAME
*"     VALUE(CLIENT) TYPE  CHAR3 DEFAULT SY-MANDT
*"  EXPORTING
*"     VALUE(USER_EXIST) TYPE  CHAR1
*"  EXCEPTIONS
*"      INTERNAL_ERROR
*"      FUNCTION_NOT_ALLOWED
*"      PARAMETERS_MISSING
*"----------------------------------------------------------------------
 
endfunction.

And in the receiving system, you give the exact same FM interface - but with the logic to populate information in the receiver DB.


function <FM_NAME>.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(USER) TYPE  USR02-BNAME
*"     VALUE(CLIENT) TYPE  CHAR3 DEFAULT SY-MANDT
*"  EXPORTING
*"     VALUE(USER_EXIST) TYPE  CHAR1
*"  EXCEPTIONS
*"      INTERNAL_ERROR
*"      FUNCTION_NOT_ALLOWED
*"      PARAMETERS_MISSING
*"----------------------------------------------------------------------
 
* Function module code here

endfunction.

Make sure you use the same name for the FM and its parameters in both the systems.

Regards,

Jinesh.

Read only

0 Likes
1,807

The schema given by you doenbt match explanation given earlier.

In earlier explanation you said Destination is export parameter but in schema given by you doesn't has schema.

Kindly guide.