Using the IServerFunctionFactory Object 

The IServerFunctionFactory object is used to create IServerFunction objects.

To obtain a reference to an IServerFunctionFactory object, use the SessionManager .

Once an application program obtains a reference to an IServerFunctionFactory, the program can create either an empty or a complete server function objects (depending on whether you are using manual or automatic creation of server function objects).

Note that an empty server function object does not have any parameter objects, and it is therefore useless for processing incoming RFC calls. You must create and add its parameters before accepting any incoming RFC calls to it.

Example

The following example shows how to obtain a server function factory object to create empty server function objects.

Note that this example assumes that a reference to the Factory Manager object is ready for use.

// _sessionMan is a reference to SessionManager
com.sap.rfc.IServerFunctionFactory serverFactory = null;
com.sap.rfc.IServerFunction rfcComputeTax = null;
serverFactory = _sessionMan.getServerFunctionFactory();
rfcComputeTax =
serverFactory.createEmptyServerFunction("RFC_COMPUTE_TAX");

              // When using manual creation
rfcComputeTax =
serverFactory.createCompleteServerFunction("RFC_COMPUTE_TAX");

              // Using automatic creation