To create a JCo Function object, proceed as follows:
Execute the getFunction() method on the JCoRepository interface.
Execute the getFunctionTemplate method on the JCoRepository interface.
Execute the getFunction() method on the Template.
In addition to containing metadata, a function object also contains the current parameters for executing the RFMs. The relationship between a function template and a function in SAP JCo is similar to that between a class and an object in Java. The code displayed above encapsulates the creation of a function object.
Note
SAP recommends that you create a new function object for each individual execution. By doing so you can ensure that the parameters do not contain any elements from previous calls.