Before storing parameters in the parameter stack, you must allocate the stack space. To do this, call:

RFC_PARAM_SPACE SAP_API RfcAllocParamSpace(unsigned MaxEx,
unsigned MaxIm,
unsigned MaxTab);

The parameters MaxEx, MaxIm, and MaxTab tell how many export, import and table parameters the calling program will use when invoking the function module. RfcAllocParamSpace then allocates enough space (in each category) for the requested number of parameters.

As in ABAP, the meaning of the terms "export" and "import" depend on point of view. The exporting parameters for a calling program are the importing parameters for the function being called. Thus an RFC caller that sends two export parameters, no import parameters, and a table should call:
RfcAllocParamSpace(2, 0, 1);
to create its stack structure. The function called, for the same set of parameters, would allocate stack space with:
RfcAllocParamSpace(0, 2, 1);

The return value (RFC_PARAM_SPACE) is a pointer to the stack space allocated.