Skip to Content
author's profile photo Former Member
Former Member

Is it possible to read windows variables ?

Hi,

I create a webdynpro view - there is a UIElement where

i want to insert the Username from the windows variables automatically ?!

Thanks in Advance.

Regards

Anilkumar

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2004 at 04:39 PM

    Correctly formulated question is a half of an answer...

    1. What is "windows variables"?

    2. What is exact type of UIElement?

    VS

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2004 at 08:41 PM

    Are you referring to the windows environment variable USERNAME?

    If so, you can certainly not read it from the client machine...

    What do you try to achieve? You might want to point your UME against your user store (LDAP) so that you can reuse your windows domain user?

    Thanks

    Bruno

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Anil,

      You can use the UME api's to read the user id. There is a weblog also on this. You can use the code below to read the user id.

      <i>IWDClientUser user = null;

      try

      {

      user = WDClientUser.getCurrentUser();

      }

      catch(Exception ex)

      {

      /* Exception Handling */

      }

      IUserAccount[] accounts = user.getSAPUser().getUserAccounts();

      if ( accounts!= null && accounts.length >= 1)

      {

      String username = (String) accounts[0].getLogonUid();

      }</i>

      Hope this is helpful.

      Regards

      Sidharth

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.