Server Sample Programs: Srfctest and SrfctestAuto
The RFC Java Class Library development kit provides two sample programs to demonstrate how to construct and use the com.sap.rfc.IServerFunction and com.sap.rfc.IServerProcess objects:
Sample Program |
Method of Constructing Function Objects |
Srfctest |
manual creation |
SrfctestAuto |
automatic creation |
Each of these programs offers the following two RFC functions:
These two functions work with the R/3 program SRFCTEST. SRFCTEST includes many options, two of which can make client calls to our sample application programs: Connection can call STFC_CONNECTION and Performance can call STFC_PERFORMANCE.
STFC_CONNECTION
STFC_CONNECTION
is implemented using the class StfcConnection.This function receives a simple parameter of type CHAR and echoes this parameter. It then returns another simple parameter of its own, of type CHAR.
STFC_PERFORMANCE
STFC_PERFORMANCE
is implemented by the class StfcPerformance.This function tests the performance of a predefined set of operations.
STFC_PERFORMANCE receives two table parameters and returns two table parameters.
Received Table Parameters
Parameter |
Type |
ITAB0332 |
H332 |
ITAB1000 |
H1000 |
Returned Table Parameter
Parameter |
Type |
ETAB0332 |
H332 |
ETAB1000 |
H1000 |
The STFC_PERFORMANCE function receives four simple parameters of type NUMC (numeric character):
Table Parameter |
Expected No. of Rows From R/3 |
LGIT0332 |
ITAB0332 |
LGIT1000 |
ITAB1000 |
LGET0332 |
ETAB0332 |
LGET1000 |
ETAB1000 |
The STFC_PERFORMANCE function returns a single-character code, EXITCODE. When its value is
O (the letter "O"), the function call was successful. When its value is E , the function encountered an error during processing. This function performs the following processing:Testing the Programs
To run the Srfctest or the SrfctestAuto programs as a server application: