on 06-23-2004 8:04 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.