Example of Set and Get Value Methods 

This example shows how to use the Value member function from CRfcSimpleParam. (The use of the member functions operator[ ] from CRfcStructParam, and Cell and Field from CRfcTableParam is similar.)

Assuming AnIntParam is a simple parameter of type RFC_INT,

AnIntParam.Value() = 5; // operator = (RFC_INT) is called on the
// intermediate CRfcData object return by
// Value(). The parameter’s value
// is set to 5.
int anInt = AnIntParam.Value();
// operator RFC_INT() is called on the
// intermediate RfcData object return by
// Value(). The parameter’s value is
// assigned to anInt.

Using Default Values for Simple Import Parameters

From release 4.0A on, the RFC class library lets external applications use default parameter values when making client RFC calls to R/3 functions. That is, callers can use the values provided by the called function, instead of providing a value explicitly in the call.

To do this, the calling application simply refrains from assigning values (using the Value() function of CRfcSimpleParam class) to the simple import parameters for which the default values are to be used. The RFC class library will also refrain from passing those parameters with no value assigned to R/3 during the call.

If a simple import parameter is assigned a value, and was passed to R/3 for an RFC call, then if the same simple import parameter with the same value is to be passed again to R/3 for the next call, then one of the two following actions can be taken: (1) Assign that same value to that parameter again, or, (2) when calling CRfcClientFunc::Call(...) or CRfcClientFunc::CallReceive(...) , set the boolean argument bPassAllParams to TRUE. Both ways would ensure that simple import parameter to be passed to R/3 again, but the second way would pass all the other simple import parameters.