7

Because the SAP Connector for .NET is no longer maintained by SAP, I am now looking for an alternative to connect the Microsoft world with the SAP world. I know there are third party products like "ERPConnect", but I want to do this with tools from SAP (by the way I cannnot use the Enterprise Services, because the target SAP system is SAP 4.6C). Therefore there arised the crazy idea to use the SAP Java Connector in combination with the tool IKVM.NET (www.ikvm.net/devguide/net2java.html). IKVM.NET provides The IKVMC tool, which converts Java bytecode to .NET dll's and exe's. "No sooner said than done!" I converted the SAP JCo to .NET dlls and created a new Visual Studio solution. I put all the JCO files into a subdirectory of my solution. I set 2 references to the generated IKVM.OpenJDK.Core.dll and sapjco.dll. Great, all JCO classes where now available as .NET classes. Full of optimism I wrote some little code to connect to a SAP system.

JCO.Client client = null; client = JCO.createClient(...)

The compiliation of my testcode had no errors. "Wonderful !" I thought. Then I started my tetstapplication. Unfortunately I got an exception calling JCO.createClient:

Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'\r\nno sapjcorfc in java.library.path

I have 2 questions on this topic.

1) Do you think my idea using the SAP Java Connector (SAP JCo) to connect .NET with SAP is a good idea or is it nonsense? Perhaps someone had already the same idea ;-)

2) How can the above exception be solved ?

Kottan
  • 4,716
  • 8
  • 39
  • 67
  • 1
    As far as I know JCO uses a native library for the connection to sap, on linux this file is called libsapjcorfc.so, probably libsapjcorfc.dll on windows. Perhaps this Library just needs to be reachable via the PATH environment variable? – Jörn Horstmann Jun 07 '10 at 09:27
  • 2
    Good news: SAP plans to release a new version of the SAP.NET Connector --> http://wiki.sdn.sap.com/wiki/display/ABAPConn/ABAP+Connectivity+Home – Kottan Jun 17 '10 at 09:10

5 Answers5

4

1) I don't think this approach is a good idea. The actual connection to sap is done not from java ( or from .net in the old .net connector). But from a c dll named, librfc32.dll. I believe that IKVM support of JNI is not complete.

It will maybe work, But, even than, it will be fragile.

Igal Serban
  • 10,190
  • 3
  • 32
  • 36
1

I would not recommend this way ! You should use the direct way. For example you can use the SAP RFC SDK.

uhu
  • 1,562
  • 4
  • 16
  • 25
1

SAP .Net Connector 3 is released. I use it at work every day...

Darbio
  • 10,681
  • 12
  • 55
  • 98
0

I think you shold have a look at Web Services, it will be more easy and more flexible.

Regards

franblay
  • 306
  • 3
  • 8
0

This sound like a classloader problem of IKVM. Take a look in the description in the wiki.

Horcrux7
  • 21,867
  • 21
  • 85
  • 134