Thursday, 4 August 2016

Creation and Calling an RFC function module from one system to another ( Ex : Addition )

Scenario:

  • We would develop a small RFC function module in 810 system, which would add two variables. We would pass two variables from 800 to 810 and get back the sum of those two variables back to 800.
  • 810 – System where RFC function module exists.
  • 800 – Calling system


Steps

  • Login into Client -810 system.
  • Go To Transaction Code SE37.
  • Enter the Function Module name which start's with Y or Z < function module name> and click on Create.
  • Pop-up will appear.
  • Click on Continue.

  • Initial Function Module screen Looks like.



  • Click on Attributes Tab.
  • Click the Radio button as : Remote-Enabled Module.
  • Click on Import Tab.
  • Enter the import parameters.
  • Click on Export Tab.
  • Enter the Export parameters.
  • Click on Source Code Tab.
  • Enter the logic.



  • Save -> Check -> Activate.
  • Now , logon into 800 client.
  • Go to Transaction Code SM59.
  • Initial Screen looks like.
  • Click on ABAP connections and click on Create.
  • Enter the RFC Destination .
  • Enter the Description.




  • To find out Targeted host.
  • Go to 810 login option.
  • Select the component and click on Change Item.
  • Copy the IP address as well as System ID.
  • Enter the Targeted Host and System ID ,



  • Press Enter.
  • Click on Logon & Security Tab.
  • Enter the Logon Details.
  • Click on Save.
  • Pop-up will appear.



  • Click on Continue.
  • Click on Test Connection.
  • Our connection works successfully .
  • Go to Transaction code SE38 ( Client 800 ) .
  • Enter the program name start's with Y or Z < Program name > and click on Create .
  • Enter the Title.
  • Select the Attribute Types as Executable Program.
  • Click on SAVE.




Source Code.




DATA : RES TYPE I.

PARAMETERS : N1 TYPE I,
             N2 TYPE I.

CALL FUNCTION 'ZRFC_ADDITION' DESTINATION 'JD_CRASTA'
  EXPORTING
    V_N1          = N1
    V_N2          = N2
 IMPORTING
   RESULT        = RES
          .

WRITE : / RES.


  • Save -> Check -> Activate.

  • Execute ( F8 ).

Input

  • Enter the Input.
  • Click on Execute.

Output



                                             more information................


No comments:

Post a Comment