4. 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

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:

 

  1. Choose Wizard to start the user interface to the DCOM Object Builder.
  2. Under R/3 Logon enter the parameters.
  3. Click on Connect to start the RFC connection.
    Under Project 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.
  4. Under Namespace, you can enter a name space description that differs from the system name, if required.
  5. Assign the DLL to be generated to a package. Select a package under MTS Package or enter the name for a new package.
  6. Determine the type of the R/3 components by selecting either Business Objects or Function Groups.
  7. If you select Business Objects, click on R/3 Business Objects in the selection window. The system then displays all BOR objects for the selected system, for which BAPI methods are defined.
    If you select Function Groups, click on R/3 Function Groups in the selection window. 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.
  8. If you select Function Groups, confirm your entries 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.
  9. 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 Objects.
  10.  

  11. If you select Function Groups, you can double-click on the object name of the proxy object to be generated if you want to change the object name.
  12. After the selection, click on Generate 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.

  13. As soon as the generation process is terminated successfully, the pushbutton Install Components 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, a scrolling marquee Your DCOM Components are succesfully generated and installed ! appears.

 

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,

  1. Start the Microsoft Transaction Server Explorer.
  2. Choose Computers ® My Computer ® Packages Installed.
  3. 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 Wizard in the Installed Components list.

 

 

Logon Parameters

When you call the Wizard, all logon parameters are displayed with the preset values maintained in the Destinations window.

 

 

Example:

 

 

 

Choose Connect:

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

 

 

Example:

 

 

 

R/3 Components

The following R/3 components can be selected:

 

 

 

 

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:

 

 

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:

  1. Start the Registry editor with regedit.
  2. Select the Registry path HKEY_LOCAL_MACHINE\SOFTWARE\SAP\MTS\ProxyGenerator\Tracing.
    The following window appears:



  3. Double-click on the entry TraceDir to select it.
  4. A dialog window appears. Enter the path name for the log file under Value data.
  5. Confirm with OK.
  6. Double-click on the entry TraceLevel to select it.
  7. 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.
  8. 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.

 

Exporting MTS Packages

 

Procedure

 

To export a package from the MTS, proceed as follows:

  1. Start the Transaction Server Explorer.
  2. Choose Computers ® My Computer ® Packages Installed.
  3. Select the package you want to export.
  4. Use the right mouse button to choose Export….
    The dialog window Export Package appears.
  5. 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.
  6. Choose Export.
    If the export was successful, the message The Package was successfully exported appears.
  7. 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:

 

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

 

 

Procedure

 

To configure the client machine for calling remote components of an exported package, proceed as follows:

 

  1. 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.
  2. 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.
  3. Start your application from the client machine.
    See Example Program: SalesOrder.vbp.