Skip to Content

How can i list all available server in saplogon.ini

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jun 23, 2004 at 07:41 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • 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).

  • author's profile photo Former Member
    Former Member
    Posted on Jan 13, 2005 at 10:55 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Reiner Hille-Doering

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.