Summary of Programming Tasks  

Your program’s overall goal is to call a function in the R/3 System, sending data as input to the function and receiving data as return values. In the Function Control, sending and return parameters are presented as further objects contained in the Function object.

Any application using OLE Automation must perform the programming tasks listed below. You should perform the first three steps for both methods of remote call access:

  1. Create the base-object - the component itself.
  2. Supply connection and logon information.
  3. Open a connection to the R/3 System and log the user on.
  4. If you are making non-dynamic remote function calls, continue as follows:

  5. Request a Function object for the R/3 function you want.
  6. Set the export and table parameter values.
  7. Make the remote call.
  8. Get the return values from the import and table parameters.

If you are making dynamic remote function calls, do not add the function to the functions collection, but write the function call like a native (local) VB function:

  1. Create table or structure objects to place data into to pass data with the table parameters or structure parameters.
  2. Invoke the function from the functions collection object.
  3. Pass parameters to the named argument such as:

Xfunc (X1: = 5, X2: = nVar, X3: = objVar)

where X1, X2, and X3 are the argument names in the function interface.

Parameters can be either simple variables or object variables.

The following sections show how to program these tasks.

Example Application with the Function Control

Variation using the Dynamic Calling Convention