GoodleAds

RFC - REMOTE FUNCTION CALL

REMOTE FUNCTION CALL

A Function which  is executed in REMOTE  SYSTEM (Not in present System)

                                                       or

These are Special types of Functions which are used to communicate with remote servers

The remote servers are    sap to sap server,
                                    sap to non-sap server.

Functions are of two types.

1.Normal Function :

These are executed in the same system and can't be executed in remote system.

2. Rfc Functions :

These are executed in Remote system.

RFC Functions are Created in SE37 with Option REMOTE ENABLE  

In Normal Function We Use Pass By Reference as Importing and Exporting Values.

In RFC Function We Use Pass By Value as Importing and Exporting  Values as we need to have Separate Memory in Present System and Remote system.

It Means it uses 2 Memory.

Normal Function are called by Statement CALL FUNCTION 'XXX'.

RFC Functions are Called by Statement CALL FUNCTION 'XXX' DESTINATION 'YYY'.

Here Destination Means The RFC Destination.

RFC DESTINATION

It is a Connection / Link between Two Systems.

SM59 is the Tcode .

Basis Team Create RFC DESTINATION.

We use the DESTINATION in our program while Calling RFC


EXAMPLE PROGRAM ON RFC:

STEP 1:

At First we will create a RFC DESTINATION between 800 to 810 Systems.

Basis Team Will Create RFC DESTINATION in Real Time.

Go to Tcode SM59.


Select ABAP CONNECTION Folder and click on CREATE ICON.




Provide a name to it and some description as below



Click on TECHNICAL Tab and Select Target Host As HOST NAME.



Click on LOGON & SECURITY Tab.



Provide LOG ON Detail as below.

Here we need to provide 810 Client Details.



Click on Save Button.

We will get an Information Message as below.




Press Enter.

Click on REMOTE LOGON ICON To Test it.



When we clicked on Remote Logon.

We will move to 810 System.

You can see the 810 System Details at the Bottom end of the Right side Screen.



Come Back now.

We will be in 800 System.

CREATING RFC FUNCTION

Before creating any Function we need to create a Function Group.

Go to Tcode SE80 and Select Function And provide a name to it .




Press Enter.

Click on YES and provide some Description to it as below and Click on SAVE.


Go to Tcode SE37.

Provide a Name and Click on Create Icon.






Provide the FUNCTION GROUP Name and DESCRIPTION.



Go to ATTRIBUTES Tab.

In Processing Type Select The Option REMOTE ENABLED MODULE.



Go to IMPORT tab and provide a Parameter and select the Check Box PASS VALUE Means PASS BY VALUE.




Go to EXPORT Tab and Provide a Parameter and select the Check Box as PASS VALUE Means Pass By Value.


Go to SOURC CODE Tab and write the logic.



Save and Activate IT.

CALLING THE RFC INTO OUR PROGRAM (SE38).

Go to Tcode SE38.

Create a program.

And call our RFC function what we created in SE37.

To Call Our Function.

Just click on PATTERN Button.




Select CALL FUNCTION and give the Function Name.


Click on Enter.


Provide the DESTINATION NAME What we created in SM59 Tcode as below.



Here we need give the inputs from 810 system then it will fetch data from it.



OUTPUT OF 810 System



No comments:

Post a Comment