Skip to Content

Finding the Logged-in User in EP

Hi All,

I want to know the login-details(user-id) of the EP user from my Web-Dynpro Application.

My Web-Dynpro is running in External J2EE engine and is called in EP using URL ivew template.

Is there anything like request or resposne(like jsp) in webdynpro ?

Can anyone help.

Thanks in Advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Nov 04, 2005 at 09:05 PM

    Check out this post.

    WebDynpro Application to get Portal User

    Regards,

    Rich HEilman

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 05, 2005 at 05:44 AM

    Hi ArunKumar,

    Try this code:

    IWDClientUser user = WDClientUser.getCurrentUser();wdComponentAPI.getMessageManager().reportSuccess("User is "+user.getSAPUser().getUniqueID());

    Hope this helps.

    Regards,

    Pooja.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Pooja ,

      Upon executing this code i am getting an

      =====================================================

      Exception : com.sap.tc.webdynpro.services.sal.um.api.WDUMException: No client user defined for the current request.

      =====================================================

      I will explain my system:-

      >EP 6.0 sp09

      >Webdynpro Application is in an external J2EE6.3 engine

      >Using SAP web-dynpro iView Template I am accessing it in EP .

      Thanks in Advance

  • avatar image
    Former Member
    Nov 06, 2005 at 11:06 PM

    Hi Arun

    Have you switched on authentication on the webdynpro app ?

    Regards

    Pran

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 29, 2005 at 11:22 AM

    Edit the application ..

    There you can add new properties

    there are some default properties..browse it and put authentication=true there...

    Now you can try the same code ..U will get the logged in user..

    AD

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Chemmam,

      Set the property authentication to true as said above

      To get the IUser class you need to add security.api jar file in your project's build path. Right click <project>->properties->Java Build path->Libraries->Add variable->

      Eclipse Home->extend->plugins->com.sap.security->

      lib->com.sap.security.api.jar.

      Write the following code to get the user

      Try {

      IWDClientUser wdUser = WDClientUser.getCurrentUser();

      IUser user = wdUser.getSAPUser();

      if (user != null)

      {

      IUserAccount[] acct = user.getUserAccounts();

      if(acct[0] != null)

      {

      String User_id = acct[0].getLogonUid();

      }

      }

      }

      Hope this helps you

      Regards

      Rohit

  • avatar image
    Former Member
    Nov 29, 2005 at 12:09 PM

    Hi Chemmam,

    In order to avoid the authentication screen you can provide user mapping for the system also

    Regards

    Rohit

    Add comment
    10|10000 characters needed characters exceeded