SAP-RFC Transfer Object example
For example, we have a function module with the name Z_FM_ADD, whose import, export and source code can be seen in the following illustration.
Import:

Import
Export:

Export
Source code:

Source code
In the OPC Router, select transfer object SAP-RFC for a new connection.

In this example, the Z_FM_ADD module function is located in the ZZ_TEST_OPC function group, and a connection called SAP_TEST was created in the SAP plug-in to access it.
Double-click to open the SAP RFC transfer object and carry out the following steps on the “Settings” tab:
- Select SAP_TEST in the “SAP access data” field.
- Click on the “Filter” button in the “Selection” field in the “Function group” area to load the function groups.
- Select ZZ_TEST_OPC in the “Function group” field.
- In the “Function” area, click on the “Filter” button in the “Selection” field to load the functions.
- Select Z_FM_ADD in the “Function” field.

Select imports and exports on the “Parameters” tab.

After you have clicked on “OK”, the transfer object SAP-RFC looks as follows:

As shown in the image below, we set “X” and “Y” to constants and enter “RESULT” in a variable.

Then click on “Make changes productive” at the top of the page.

And in the “Publish” area, click “Make changes productive” again.
.png)
Then trigger the connection in the Status Indication by right-clicking on your connection and then clicking on “Trigger connection”.

Finally, as expected, the value of “RESULT” is equal to the sum of “X” and “Y”.
