Generating and Installing COM Objects
The generation and installation process is controlled via a user interface to the DCOM
Object Builder, the Connector Wizard.
This section contains the following topics:
Using the Connector Wizard
Logon Parameters
Specifications for DCOM Components
R/3 Components
Versions of Proxy Objects
Troubleshooting for the Build Process
Debugging
Versions of Project
Exporting MTS Packages
Configuring the Client Machine for Calling Remote
Components
Using the Connector Wizard
Prerequisites
The initial screen of the R/3 DCOM Connector Wizard is already displayed. If not, open
file default.htm in the directory rfcsdk\ccwww\ .
Procedure
To execute the generation and installation process, proceed as follows:
- Choose Object Builder to start the user interface to the DCOM Object
Builder.
- Under R/3 System specify the connection
parameters.
- Click on Logon to start the RFC connection.
- Under COM/MTS enter the project directory and the name of the project file. For a remote generation, you must enter the
corresponding UNC path name. To do this, use the Browse key.
- Under Namespace, you can enter a name space
description that differs from the system name, if required.
- Assign the DLL to be generated to a package. Select a package under MTS Package or
enter the name for a new package.
- Choose Session for generation of a session object and specify the name if
deviates from the default.
- Determine the type of the R/3 components by selecting
either Bapi or RFC Function.
- If you select Bapi, click on R/3 Business Components in the
selection window. The system then displays all BOR objects for the selected system, for
which BAPI methods are defined.
If you select RFC Functions, click on the button Select RFC Functions.
The system then displays a dialog window. There you can either further restrict the number
of remote functions of a function group or select individual remote functions.
- If you select RFC Functions, confirm your entries from dialog box with OK.
The system reads the selected function groups and the corresponding remote functions from
the R/3 Repository and displays them in a tree structure.
- Select the components to be generated and choose Add
® . The system copies the selected components to the selection window
for the generation and adds them to the structure under COM Components.

After the selection, click on Build Component DLL to start the generation
process for DCOM proxies.
All selected components are assigned to the Projectfile.DLL.
In the first generation step, the system creates source files. In the second step, the
system creates the DLL and the Type Library.
Note:
Before the system starts the generation, it checks whether a version of the
component is already registered in the MTS.
It also checks whether a DLL of the same name already exists in the project directory.
For more information, see Versions of Proxy Objects.
Note:
If the generation fails, you can find the possible reasons in the log file Project.log
in the project directory. For more information, see Troubleshooting
for the Build Process.
As soon as the generation process is terminated successfully, the pushbutton Install
Component DLL in MTS becomes active.
Click on the pushbutton to start the installation process.
This calls the DCOM Object Builder that installs the generated DLL in the specified MTS
Package. As soon as the installation process is terminated successfully, the system
displays the message Generated component(s) succesfully installed in MTS!.
Result
Together with the installation, the DCOM proxies are entered into the Windows Registry.
The installed DCOM proxies are now visible in the MTS Explorer.
To display the newly installed DCOM proxies,
- Start the Microsoft Transaction Server Explorer.
- Choose Computers
® My
Computer ® Packages Installed.
Select < the package specified under MTS Package > ® Components.
The generated DCOM proxies are displayed in the Detail Viewer according to the
convention for COM objects in the form < Namespace . Objectname . Version >.
Note:
If the MTS Server is already running, update the display of the installed packages by
choosing Refresh (right mouse button or icon).
Example:

Note:
You can display the installed components also in the R/3 DCOM Connector initial
screen in the Installed Components list.
Connection Parameters
When you call the Wizard, all logon parameters are displayed with the preset values
maintained in the Destinations window.
- Destination
Select the destination from the list. The system
displays a list of all destinations maintained.
- Client
Client number.
- User
User name for remote logon, if it is different from the currently logged on user
name.
- Password
User password
- Language
The system language to be used
Example:

Choose Logon:
This function allows you to test the selected destination and thus the RFC connection
to the /3 system.
If the logon parameters are valid, the system establishes an RFC connection to the
server. Next to the deactivated pushbutton Connected to the corresponding system
name appears.
If the logon parameters are invalid, the Microsoft Internet Explorer displays an error
message with a short description of the error reason.
Specifications for DCOM Components
C++ Project
Absolut path name of the MAK file for the project to be created. Choose Browse
to select a directory or create a new one. Enter the name for the project file. The system
then creates a MAK file with this name.
Target DLL
In this output field, the system displays the name of the DLL to be generated (Projectfile-name.DLL).
Namespace
You can enter up to four characters. They specify the name space and are used as
prefix for the COM object names in the MTS. Namespace is also used in the
naming convention for the name of the Type Library, which you must specify under References
in a VB project.
You can specify any name. However, we recommend to either use the name of the called R/3
system or an abbreviation of the company name. The default is set to the system name.
MTS Package
A package contains a set of COM objects. All objects of a common package run in a
common MTS server process. The DLL is loaded into the address space of an MTS server
process. With its runtime environment, MTS thus serves as host for COM objects.
Note:
Any number of DLLs can be assigned to a single package.
Session
Set the flag for generation of a session object.
Example:

R/3 Components
The following R/3 components can be selected:
- Bapi
The system displays all BOR objects for the selected
system, for which BAPI methods are defined
Example:

- RFC Functions
With the Select button appears a dialog window, where you can further
restrict the selection of remote functions. You can select one of the following
restrictions:
Functions
An individual remote function with specified
release mode.
Groups
All remote functions of a function group with specified release mode.
Customer
All function groups and remote functions that are released for customers.
SAP
All function groups and remote functions that are released for SAP.
All
All function groups and remote functions that can be accessed within the selected
SAP system (including those that are not released).
Example:

Versions of Proxy Objects
If one or more DCOM proxies are already installed and registered, you can update them
to a higher version. Such an update can be reasonable if the corresponding R/3 component
was enhanced by new functions (methods), such as a new R/3 release. This would allow you
to have several versions of proxy objects.
For this reason, the system checks before starting a generation process, whether a
version of the component is registered in the MTS. If so, it displays a dialog window with
an appropriate message:

You can then choose whether to install a new version or not. If you confirm with
Yes, the system installs and registers another version of the proxy object.
The version number of the object is increased by one and displayed accordingly in the
Detail Viewer of the MTS. If you confirm with No, the system does not
execute another generation but accesses the existing entries in the Registry.
In addition, the system checks whether a DLL with the same name already exists in the
project directory. If so, it displays a message and you can choose whether to overwrite
this file or not. If you choose Yes, the system removes all components contained in the
DLL from the MTS and all corresponding entries from the Windows Registry. If you choose
No, a new generation is not possible.
Troubleshooting for the Build Process
There are severals utilities that allow you to find errors occurring during the build
process:
- Utilities for errors occurring during the creation of source files.
- Utilities for errors occurring during compilation and linking.
- Activating an RFC trace to log the RFC communication.
Errors Occurring During the Creation of Source Files
If the TraceLevel is set to a value between 1 and 5, the error data is stored in file proxygenxxx.log
in a directory specified in the Registry. The extension xxx in the
file name is a more-digit number generated by the Builder.
Procedure
To specify the TraceLevel and the directory in the Registry, proceed as follows:
- Start the Registry editor with regedit.
- Select the Registry path HKEY_LOCAL_MACHINE\SOFTWARE\SAP\MTS\ProxyGenerator\Tracing.
The following window appears:

Double-click on the entry TraceDir to select it.
A dialog window appears. Enter the path name for the log file under Value data.
Confirm with OK.
Double-click on the entry TraceLevel to select it.
A dialog window appears. Enter a value between 1 and 5 under Value data.
The higher the value, the more detailled the tracing will be.
Confirm with OK.
The current values appear in the editor under Data.
Errors Occurring During Compilation and Linking
Generation can also fail during compilation and linking. You can find the error data in
the log file Project.log and thus detect possible error reasons. The log
file is stored in the project directory you specified.
Activating the RFC Trace
You can log the RFC communication to the selected destination in a trace file. Set the
appropriate option in the R/3 DCOM Connector Wizard in the window Administration and
Destination Management. See also Maintaining Destinations.
The system writes log information into the trace file rfcxxx_xxx.trc and
stores the file in a standard directory. The directory is preset under Working
Directory in the window Monitor
® Parameters, where you can change it, if required.
The extension xxx in the file name is a more-digit number.
Creating Debugging Versions of the Project
For debugging, the C++ programmer can use a special debugging
version of the generated project. This allows the programmer to check in detail, for
example, the parameter transfer in the generated C++ coding.
Prerequisites
The corresponding project DLL is generated and installed.
Procedure
In the Visual Studio IDE open the generated MAK file Project.mak.
To set the debugging flag, choose Project Settings -> General and under Build
command line enter the addition BUILD=D.
Specify the RFC SDK include directory to be able to refer to the appropriate include
files. Choose Tools ->
Options and in the field Directories enter the name of the RFC SDK
include directory.
Start the C++ compiler.
Result
The new debugging version overwrites the original project file DLL, unless you
explicitly create a copy for the original.
To execute the debugging version of the DLL in the MTS process, choose Project
Settings -> Debug.
In the field Executable for debug session specify the directory name for the
MTS (<directory>/mtx.exe). In the field Program arguments specify the
respective package ("/p <Package Name>") as argument.
Exporting MTS Packages
Procedure
To export a package from the MTS, proceed as follows:
- Start the Transaction Server Explorer.
- Choose Computers
® My
Computer ® Packages Installed.
Select the package you want to export.
Use the right mouse button to choose Export
.
The dialog window Export Package appears.
Enter the complete path name for the package file to be created. To do this, choose Browse,
select the directory, enter the file name, and confirm.

MTS automatically adds the extension PAK to the file name.
Choose Export.
If the export was successful, the message The Package was successfully
exported appears.
Choose OK to close the message window.
Result
The MTS package was exported and an executable file for the client configuation was
created. The directory you specified in step 5 now includes two files and a subdirectory:
- <Projectfile>.dll
- <Exportfile>.pak
- subdirectory clients, which contains the executable file <Exportfile>.exe.
You can use the two files <Projectfile>.dll und <Exportfile>.pak on
another MTS by importing them there.
You can use the executable file <Exportfile>.exe to configure the client
in a way that allows executing remote components via DCOM.
Configuring the Client Machine for Calling
Remote Components
To remotely access MTS components from within an application on a client machine, you
need the respective entries for the components in the Registry of the client machine.
Prerequisites
VB development environment installed on the client machine
Procedure
To configure the client machine for calling remote components of an exported package,
proceed as follows:
- Copy the file <Exportfile>.exe from the clients directory to a
directory on the client machine, from which you want to call the remote MTS.
- Start the executable file <Exportfile>.exe on your client machine.
The required entries are written to the Registry to configure the client machine for
calling remote components.
- Start your application from the client machine.
See Example Program: SalesOrder.vbp.