Extended Function Reference

Visual Basic programs that make RFC calls without using SAP-generated stub programs need the extended functions described in this section.

If possible, the extended functions described in this section should only be used in Visual Basic stubs, except for RfcOpenExt.

SAP offers the extended functions because Basic does not pass table structures in a manner compatible with RFC API functions. (In particular, structures containing character strings are problematic). Structure-passing is required when you use the non-extended API functions. Both Basic and C programs may call the extended functions.

The extended functions perform the same RFC tasks, but include specialized parameter-passing. Routines are provided for:

·        allocating and freeing stack space

Ў        RfcAllocParamSpace

Ў        RfcFreeParamSpace

·        storing and retrieving parameters in stack storage

Ў        RfcAddImportParam

Ў        RfcAddExportParam

Ў        RfcAddTable

·        performing RFC tasks,

passing the stack storage instead of RFC_PARAMETER / RFC_TABLE structures:

Ў        RfcOpenExt

Ў        RfcOpenExtV3

Ў        RfcCallExt

Ў        RfcReceiveExt

Ў        RfcCallReceiveExt

Ў        RfcGetDataExt

Ў        RfcSendDataExt

Ў        RfcInstallFunctionExt

Entry points for the extended functions are all declared in saprfc.h. The program testrfc.c which is included in the RFC SDK shows how to use the RFC Extended Functions to make an RFC call.

In many of these routines, the token SAP_API is included. SAP_API containsplatform-dependent keywords which are neccesary to allow dynamic linking of these function from various environments. On Windows, for example, SAP_API is __extern __loadds __pascal __far.