Scenario :
Calling a FM from one system (Sys1) to another (Sys2) via RFC.
Steps :
Below are the steps we follow to work with RFC (assuming you know the concepts of Function Module otherwise suggest to understand working with Function Module before going through the scenario).
Identify the FM to be called from other system (Sys2 here).Let us say we need to call Function Module BAPI_WEBINVOICE_GETDETAIL from Sys2 to get the Invoice details.The first prerequisite is the called FM should be remote enabled as below :
In Sys1 Goto transaction SM59 to create a RFC connection to Sys2. Enter RFC Destination name (say Zwebinvoice),Connection Type (F4 and select) and Description.
In Technical Settings tab enter the Sys2 system details and Save.
Once saved need to test the connection so click on TEST CONNECTION.If there is error you will get error message.
After connection goto you program in SE38 and call the remote FM as below:
Here lc_dest is constant for destination "Zwebinvoice" and sent values from my report to the FM as Import parameters and found the web Invoice Items in lt_webinvoiceitems. Data type as below: