cancel
Showing results for 
Search instead for 
Did you mean: 

.Net on terminal server - saplogon.ini

Former Member
0 Kudos

If you run SAP through a windows Terminal Server, the SAP GUI uses the SAPLogon.Ini file in the terminal server windows directory but the .NET Connector reads the INI file from the users windows directory (under documents and settings).

This is a known issue with terminal server, which was designed to allow legacy applications to run (using the now obsolete mechanism of using an INI file in a Windows application).

Quite frankly I am surprised that SAP still use this antiquated feature and I am hoping for two possible workarounds

(a) Override the SAPDestination object so that it can be configured in a different way than reading the SAPLogon.INI

(b) Tell the SAPDestination to read the correct INI file

I have tried constructing the SAPConnection connect string directly, but it appears that the .NET Connector fundamentally requires a SAPDestination to be created.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks. The issue is that once the SAPLogon.INI has been created the first time for a particular user, then it will never be over-ridden again.

This means that as soon as another entry is added to the SAP GUI it will not cause all SAPLogon.INI files to be updated with the same information.

Do not worry. This is a standard Windows Terminal Server issue and we can work around it. In terms of correcting the behaviour, I would say that the .NET Connector is at fault as this was supposed to be mimicking the behaviour of the SAP GUI.

Many regards

Chris Brookes.

Former Member
0 Kudos

Many thanks for your information. We will try to bypass the use of SAPLogon.INI by replicating the necessary information in our own application database. We may even try to query the SAPLogon.INI file directly ourselves. My only worry in the latter case is that SAP GUI seems to have gone through several versions recently and I wonder if it has consistently used the same method to read SAPLogon.INI

As an aside, GetPrivateProfileString with no explicit path will look in the users Windows directory. I suspect that SAP GUI deliberately uses the windows terminal server windows directory. My only comment is that this should really be consistent in the .NET Connector implementation.

Many regards

Chris Brookes

reiner_hille-doering
Active Contributor
0 Kudos

I was doing some research. The pricipal operation of GetPrivateProfileString in WTS is described in the following article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;186498

Unfortunately I don't fully understand it. It seems to me that GetPrivateProfileString will try to find the INI in the User's directory. If it's not there, it will copy from Windows-Dir. Later it would automatically keep the user-file and the main-file in sync - so you should not have a problem. The article also explains how you can set some mapping option in the registry.

reiner_hille-doering
Active Contributor
0 Kudos

I don't know how SAPGUI uses SAPLOGON.INI, but NCo calls standard Windows API GetPrivateProfileString and so on. I don't know details on how you could configure the beviour of the function in WTS, I at least remember that there are lot's of features how to control this function to support Registry-Mapping.

You are right that INI-files are not the most up-to-date technolgy, but they are used by SAPLOGON for long time and we support it as conveniance.

Of cause you can also use standard Destination (which doesn't do anything about SAPLOGON.INI) or use normal connections strings.