Using Named Argument Calling Conventions 

Since named argument calling conventions do not have qualifiers to distinguish the import parameters from the export parameters like the calling conventions used in ABAP, you must be aware which is the import parameter and which is the export parameter. From a caller’s point of view, you can use either variables or constants for exporting parameters. However, you can only use variables for importing parameters so that the variables can store the returned data.

From the caller’s point of view, if the exporting parameter is a structure and you want to pass data to this parameter, you must first create a Structure object using the CreateStructure method of the Functions collection and fill data in the Structure object. If the import parameter is a structure, you can pass any variable to receive the returned Structure object. There is no need to create Structure objects yourself.

If you only want to retrieve data in table parameters, you can use any variable. There is no need to create Table objects yourself. The remote Function object creates the Table objects and stores them in your variables. If you want to pass data to the table parameters, you must first create a Table object in the table component and assign data to the able object. Then, you can pass the table object to the table parameter.

The following example illustrates these two scenarios.

For the remote function interface:

xFunc

Importing IP LIKE TP-IP

SIP LIKE SX STRUCTURE SX

Exporting EP LIKE TP-EP

SEP LIKE SY STRUCTURE SY

Tables TP STRUCTURESZ

If you only want to retrieve data, the following VBA code illustrates the calling statement.

Call the xFunc remote function:

R3.xFunc IP:= 1, SEP:= objStruct, EP:= nVar, TP:=objTable

where objStruct , nVar , and objTable can be uninitialized.

If you want to pass data to the table parameter and the export parameter with the structure type, the following VBA code illustrates the calling statement:

Create a Structure object with structure type "SX":

set objMyStruct = R3.CreateStructure( " SX " )

Create a Table object with table structure type "SZ":

set objTable = R3.CreateTable( " SZ " )

Fill in data for objMyStruct and objTable here:

...

Call the xFunc remote function:

R3.xFunc IP:=1, SIP:= objMyStruct, EP:= nVar, SEP:= objStruct, TP:=objTable