cancel
Showing results for 
Search instead for 
Did you mean: 

How can i list all available server in saplogon.ini

0 Kudos

Hi,

I want to list all available server in saplogon.ini. The sapLogonDestination seems alread read it. But how can I put it in the the dropdownlist ?

Thanks

Wilson

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

AvailableDestinations seems to run only when saplogon.ini is in the "default" places. In our configuration where the Path to saplogon.ini is indicated via the environment string SAPLOGON_INI_FILE the property AvailableDestinations is always empty. Eventhoug saplogon.exe shows all entries.

Has anybody some ideas or some help?

Thanxalot

reiner_hille-doering
Active Contributor
0 Kudos

That's true. SAPLogonDestination expects SAPLOGON.INI in Windows directory. You can consider this as bug. It might be fixed in the future, but I can't you give any date.

Former Member
0 Kudos

If you extend it, could you extend it in a way that it also supports arbitrary pathes? I do not use the environment variable but the command line option in a short cut like the following:

C:\Programme\SAP\FrontEnd\SAPgui\saplogon.exe -INI_FILE="d:\daten\offline\sap logon\saplogon.xxx.ini"

By this I am able to logically group the SAP systems.

Thank you,

Willy

reiner_hille-doering
Active Contributor
0 Kudos

Check the AvailableDestinations property. Here the docu:

Convinience Property for other classes to read all available destinations.

They are return as key/value pairs by the IDictionary enumerator.

0 Kudos

Would you mind to describe more detail ?

I know there are two properties - Keys and Values in AvailableDestinations. How to put them in the dropdownlist ?

Thanks

Wilson

reiner_hille-doering
Active Contributor
0 Kudos

It's like all dictionaries, e.g. like with a Hashtable.

"Keys" are the internal keys used inside of saplogon.ini, e.g. "Item1", Value is the print name of the Destination, usually the thing you want to show in the Dropdown.

So, an easy implementation to fill a Windows Forms Combo box is:

foreach(string s in this.sapLogonDestination1.AvailableDestinations.Values)

{

this.comboBox1.Items.Add(s);

}

You can also iterate over the Key/Value pairs.

This is especially usefull if you later want to use the key for seeting the DestinationKey property (which is more effitient that to set the DestinationName). A WebForm DropDownList control could be filled as follows:

foreach(DictionaryEntry entry in this.sapLogonDestination1.AvailableDestinations)

{

this.DropDownList1.Items.Add(new ListItem(entry.Value, entry.Key));

}

Later you could use the selected key:

this.sapLogonDestination1.DestinationKey = this.DropDownList1.SelectedValue;

BTW: Even simpler is to fill the DropDownList using DataBinding:

this.DropDownList1.DataSource = this.sapLogonDestination1.AvailableDestinations;

this.DropDownList1.DataTextField = "Value";

this.DropDownList1.DataValueField = "Key";

this.DropDownList1.DataBind();

(or do the same settings in the designer).