cancel
Showing results for 
Search instead for 
Did you mean: 

COM and .NET Connector

Former Member
0 Kudos

We have some VB6 applications that currently interact with the SAP BC. We want to extend these apps to use the .NET connector, and are planning on putting a COM wrapper around a .NET connector object using VB6. Has anyone done this? We can't re-write these apps in .NET, and are trying to elimante the SAP BC. Thanks.

- Bret

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Does anyone have some examples as to how to access the COM wrapper around a .Net connector. I am just starting with com interop and i have created the wrapper for SAP.net connector as a standalone class. I can see all the members of the class from VB6 but don't realy know which one to use. I am trying to pass a table to Z_Kofax_Rel RFC.

e.g

Sub Z_Kofax_Rel(Success As String, Documents As ZAP_TMP_REGISTERTable)

ZAP_TMP_REGISTERTable expects a row of data e.g batchid,scandate,imageid etc..

Former Member
0 Kudos

You can use DCOM Connector, this was created before .Net connector some years ago.

The SAPGUI installer includes this tool, but you have to install also Visual C++ because this tool uses it for create the code and compile the DLL.

After the creation of the DLL you can add the reference in your VB6.0 projects (or ASP pages)

You can downdoadit also from http://service.sap.com/connectors

Former Member
0 Kudos

Rafael,

We have attempted to use DCOM in the past and did not find it to be a good tool for us. We actually replaced it with the SAP BC in the first place.

We are going to investigate the COM wrapper and/or re-writing portions of the applications in .NET where applicable.

Bret

Former Member
0 Kudos

Hi,

Just in case your posting IDOCs to the SAP BC...

The .NET connector has a IDOC receiver and IDOC Sender class

Regards

elko_hasse
Participant
0 Kudos

Support for DCOM connector will run out by the end of this year (see note 533055).

Depending on how critical your system/applications is, it is a good idea to switch to .net Connector.

elko

Former Member
0 Kudos

Hello,

I think you had better use C# directly to make the .NET Connector object COM callable.

The easiest, but not necessarily the best way is:

a) Manually modify the generated C# code by addding

[ClassInterface(ClassInterfaceType.AutoDual)]

to all public classes.

b) Rebuild the assemply.

c) Use .NET SDK utility regasm.exe to export the .NET assembly to a COM type library and register type library.

d) Use VB6 or other COM aware languages to accesss the component as usual.

I would like to mention that it is generally not recommended to expose a .NET class to COM by using ClassInterface attribute. The better way is to explicitly use interface to tailor COM interop. Please refer to MSDN for details about COM interop.

Regards,

Guangwei

Former Member
0 Kudos

Hello Li,

we are trying to make things work as you tell us, but we want it to work remote too (with COM+)

We do the following:

-create a C# class library project

-create a proxy using SAP .net Connector 2.0

-add the [ClassInterface(ClassInterfaceType.AutoDispatch)] directive in front of the class definition of the proxy

-give it a strong name using sn.exe -k and referring to the key.snk file

-compile this to a DLL

-regasm myDLL.dll

-tlbexp myDLL.dll

-gacutil /i myDLL.dll

-TEST: this DLL works fine with a local VB6 app

-then we create a new COM+ application in the Windows XP Component Services

-in this COM+ application, we drag our TLB file

-we change the properties of our proxy object to allow object creation

-we export this COM+ application as an application proxy

-we install the exported msi file on a remote computer

TEST:

VB6 program on remote computer with references to our proxy DLL on the server.

We can browse all methods on the client.

We see that an object is being instantiated on the server computer, but immediately after this we get a 'File not found' (no files in our server object, except maybe an ini file with the SAP settings of our Application Server in the Server Explorer), and sometimes a 'ActiveX object could not be created' on the client.

My question:

We decided to replace the SAP DCOM Connector by a COM Callable wrapped SAP .net Connector in COM+ since the client application cannot easily be updated (lots of remote clients, being used 24h a day).

Do you think we use the right approach to solve this?

Can you see why we fail till now to make things work?

Has someone else already succesfully wrapped a SAP .net Connector 2.0 proxy as a COM+ application?

Regards,

Wouter

Former Member
0 Kudos

Hi,

Please

- Make sure that both SAP.Connector.DLL and SAP.Connector.Rfc.Dll are also installed in GAC.

- Make sure that the security settings of your COM+ app are correct.

- Uncheck "allow object construction" because I'm not sure if a CCW support this feature.

You may need to re-export your COM+ app proxy for your DCOM client after making any change in COM+.

Regards,

Guangwei Li

Former Member
0 Kudos

You could access SAP data using webservices.

All the RFC can be exposed as a web service.

Include the required assembly + soap toolkit as long as you are only supporting SAP R3.