There are two types of applications that can be built based on the SAP
DCOM Connector (SDC): server-based applications and desktop applications.
This article will be more useful to you if you are interested in the latter
type, but some of the information will also apply to the former.
Before 4.6D, you had to define any SAP
system you wanted to log on to from an SDC-based application in the Windows
Registry. This was accomplished using either the SDC Administration
facilities (see Figure 1) or the API provided by the SDC CCADMINLib.CCRegistry
SDC originally did not take into account
SAP systems already defined in the saplogon.ini file for SAPGUI.
As a consequence, these systems had to be defined redundantly in the Windows
Registry and any changes had to be made in two locations. While this is
only a minor issue for server applications, since SAPGUI is typically
not used a lot on server machines, it was somewhat annoying for developers
and users of SDC-based desktop applications. The 4.6D version of SDC,
which can be used with any SAP back-end system running release 3.1 or
later, has been extended to automatically leverage any SAP system defined
in saplogon.ini. Redundant system definitions are no longer necessary!
||Destination Administration with the SAP DCOM Connector
The Freeware Logon Component
A while ago, I had written a freeware component (the ARAsoft DCOM Connector
Logon Component for SAP R/3) that can be used in desktop applications
to provide a user dialog encapsulating the logon process. Figure 2
shows a screen shot of that component in action.
||The ARAsoft DCOM Connector Logon Component
All destinations (SAP systems) are listed
on the left-hand side. The user can look at the destination details and
enter the required information for logon (client, userid, password, and
language). Instead of requiring users to memorize the ISO code of the
language they want to use, the component offers a drop-down combo box
that lists the name of the language in the language itself.
Writing a client program that uses the
component is very easy. Listing 1 shows the required code in Visual
Instead of IRFC32Lib.RfcSession,
any session class generated by SDC into a proxy DLL could be used.
Originally, the component immediately retrieved
not only the list of destinations, but also the details of each destination.
This performed nicely, since each access to a destination's details just
required one access to the Windows Registry, which is a reasonably fast
endeavor. Once I started to use SDC
4.6D, though, I noticed that it took several seconds for the logon
dialog to come up. The reason for this performance degradation is that
API opens and closes the saplogon.ini file every time the details of a
destination taken from that file are accessed. The obvious solution is
to retrieve only the list of destinations initially, and access the detail
data "just-in-time" as needed.
Since you may want to build your own visual
logon component for desktop applications, or build a non-visual component
that accesses destinations for use in a server-based application, I have
decided to share the required source code with you.