cancel
Showing results for 
Search instead for 
Did you mean: 

C # Aplication connection with SAP Windows CE

Former Member
0 Kudos

Hi,

I have a problem with an aplication that I've made in Visual Studio C#. The problem is the next:

I've made an aplication that connects with SAP and passes some data. This aplication works well on any computer but I've got a problem when I tried tu convert the code and use it in a hand help pc. The version of OS of the hand held pc is Windows CE 5.0 and the error that I get when I execute my software is something related with the COM and the Class ID, the error says the next:

"COM object with CLSID '{B24944D6-1501-11CF-8981-0000E8A49FA0}' cannot be created due to the following error: Class not registered ."

I think that the problem could be with some dll that I don't have installed on the hand held pc but I don't really know which or what exactly.

Does anyome know anything about all of these??

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vanessa,

I think people here have misunderstood your question. If I am not wrong, you are using a control from SAP Logon Pad or in other words an SAP GUI for Windows component. These dlls and ActiveX controls were tailor made for 32 bit Windows PC Platform (x86 architecture). Most probably, even copying these files (dll,ActiveX control) to the PDA/Win CE device might not suffice as can be seen from the reason above.

This I think answers your question properly, or in other words, you cannot connect / logon to SAP from handheld without a tailor made logon dll, ActiveX control. Please mark the question as answered if my reply was helpful. Points are welcome too.

Regards,

Veera

Former Member
0 Kudos

Is it the same version of .net as on your computer?

Julien.

Former Member
0 Kudos

Hi Julien,

Yes, I'm ussing Visual Studio 2005 for both, I didn't change the version of .NET, thats why I'm a bite confuse.

The problem comes when my aplication tries to create de object for the connection, for example:

sap = new SAPLogonControl();

When it tries to execute this line is when the error appears. That's, also, why I think that the problem is with some kind of dll missing.

Thanks for the help.

Former Member
0 Kudos

Hi Vanessa,

I am not 100% sure if I get your question corretly, so apologyse if I am wrong here.

On PDA there is no COM server available. That I was told by Microsoft a while back. The guy told me I have to go through the pain and use ActiveX controlls on PDA still - or use JNI.

So I guess you have written an .Net controll and you want to use this on PDA? Well, based on info above this is not possible.

Hope this helps.

Regards,

Oliver

[www.placeworkers.com]

Former Member
0 Kudos

Hi Oliver,

Thanks for your answer, but I don´t really understand what you say . I didn't make a .NET controller. What I've done is the next:

-In a normal PC:

  • The first thing that I had to do was find out a dll library that could connect my aplication with SAP. That dll is the Interop.SAPLogonCtrl. This library is inserted in my C# code, so that I can access the function. For example:

private SAPLogonCtrl.Connection conexion;

saplogon = new SAPLogonCtrl.SAPLogonControlClass();

saplogon.User = usuSAP;//Usuario SAP.

saplogon.Password = passSAP;//Contraseña del usuario de SAP.

saplogon.Language = "ES";//Idioma.

saplogon.Client = cliSAP

saplogon.ApplicationServer = "XXX.XXX.XX" + serSAP;

saplogon.System = sysSAP;

saplogon.SystemNumber = System.Convert.ToInt16(num_Sis);

With all these parameters and other more y can get a connection to my SAP system.

-On the hand held pc:

Here the problem is that I don't know which dll could replace the one that I have used on the aplicacion made for the normal PC.

The question is that I don't want make a .NET control y only want to get a conection throw my aplication to SAP and send some data tu a Z_function that's made for this use.

Thaks.

Former Member
0 Kudos

Hello Vanessa,

The version of .Net in Visual Studio 2005 might not be the latest version that you are using on your system. Try redownload and reinstall .Net 3.0 for both your laptopp and your PDA and see if it works.

Otherwise it is really hard without the actual code to find out what is missing.

Thank you,

Julien.

Former Member
0 Kudos

Hi Vanessa,

I think the issue is the control you are using. On a PDA you have only a Compact version of the original Framework. So in your case, I would say, that you try to use a .NET component that was developed for the full blown .Net framework. Cause in the compact version a few things are missing, it is most likely not possible to run this DLL on the mobile device. If you have a look into the spec you will see that it needs the complete NEt stack and this will not run on the PDA. Anyway, try it with the latest Visual Studio version and the latest .Net version - but I know from the last time I have done it, that it was not possible to use the SAPLogonCtrl.

Regards,

Oliver

Former Member
0 Kudos

Hi Julien,

To do the connection on a normal PC I include in the code the next references: SAPLogonCtrl and SAPFunctionsOCX.

Once they are included in my code I do the next:

private SAPLogonCtrl.SAPLogonControlClass saplogon;

private SAPLogonCtrl.Connection conexion;

private SAPFunctionsClass func = new SAPFunctionsClass();

SAPFunctionsOCX.IFunction sapfu = null;

Then I have a method to connect to SAP and other to pass the data. The one that connects to SAP is:

private void Connect_SAP()

{

saplogon = new SAPLogonCtrl.SAPLogonControlClass();

saplogon.User = usuSAP;//Usuario SAP.

saplogon.Password = passSAP;//Contraseña del usuario de SAP.

saplogon.Language = "ES";//Idioma.

saplogon.Client = cliSAP;//Mandante a través del cual nos vamos a comunicar con SAP.

saplogon.ApplicationServer = "10.10.20." + serSAP;//Ip en donde se encuetra el Servidor de SAP.

saplogon.System = sysSAP;//Entorno al que vamos a acceder.

saplogon.SystemNumber = System.Convert.ToInt16(num_Sis);

conexion = (SAPLogonCtrl.Connection)saplogon.NewConnection();

conexion.Logon(0, true);

DateTime hora = DateTime.Now;

if (conexion.Logon(0, true)==true)

{

MessageBox.Show("Conectado a SAP");

*Error1.Text += "SAP:Conexion establecida con exito" + "

";*

Write_log("SAP", "Conexion establecida con exito",hora);

}

else

{

MessageBox.Show("No establecida conexión con SAP");

*Error1.Text += "SAP:No se ha establecido la conexion con exito" + "

";*

Write_log("SAP", "No se ha establecido la conexion con exito", hora);

}

func.Connection = conexion;

if (sysSAP == "PRO")

{

labelSystema.Text = "Productivo";

}

else

{

labelSystema.Text = "Desarrollo";

}

}

Now the problem is that I want to use these code to make the same connection on a handheld PC but it doesn't work, when I execute the compilation on the handheld PC I get the next error:

"COM object with CLSID '{B24944D6-1501-11CF-8981-0000E8A49FA0}' cannot be created due to the following error: Class not registered ."

When this happens the compilation stops and it shos me the line in the code thar points to:

saplogon = new SAPLogonCtrl.SAPLogonControlClass();

I don't know why I get this error, I think that it could by that I'm not using the correct dll for a handheld PC that uses a Windows CE 5.0 O.S.. My question is: do I have to get a new dll that works on a handheld PC? or is it not working for any other reasson.

Thanks for your help.