on 08-26-2008 11:36 AM
Hi,
How to read the first name(userid) who currently logged in portalu2026
here my requirement is I m having an iview which displays the user name who currently logged in portal. How to do that.
Another requirement is in iview I want a link. When I click on that link it should navigate to another role. How to call that role when I click on the link
Regards
Venkat
Can you try with the below code to get the looged in user id
try
{
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
if (user != null)
{
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
epUser = epUser+acct[0].getLogonUid();
String test=acct[0].getUniqueID();
}
}
else
{
wdComponentAPI.getMessageManager().reportSuccess("USER NULL");
}
}
catch(Exception e)
{
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this link...
Getting Logged in Portal User Details in Web DynPro
/thread/366457 [original link is broken]
Thanks.
Abhilasha
Edited by: Abhilasha Dahare on Aug 26, 2008 1:17 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
u can get the user name using the below code,
String userid="";
try {
IWDClientUser user = WDClientUser.getCurrentUser();
userid = user.getSAPUser().getUniqueName();
} catch (WDUMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Thanks,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ramesh,
I am getting below exception:
The initial exception that caused the request to fail, was:
java.lang.NullPointerException
at com.portalrolesapp.View2.wdDoInit(View2.java:126)
at com.portalrolesapp.wdp.InternalView2.wdDoInit(InternalView2.java:122)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
Hi,
In addition to code mentioned you will need to add one external jars in the build path of your project. You can do this by right clicking on your Project Name ==> Properties ==> Java Build path ==> Add variables ==> WD_Runtime--- and Extend.
The jar name is:-
1)com.sap.security_2.0.0
Thanks,
ramesh
Edited by: Ramesh Babu V on Aug 26, 2008 6:02 PM
please provide the source code you have written, as following code is running fine at my end.
String uname = null;
try
{
IWDClientUser cUser = WDClientUser.getCurrentUser();
IUser user = cUser.getSAPUser();
uname = user.getUniqueName();
}
catch (Exception ex) {
ex.printStackTrace();
}
Regards,
Jawed Ali
Hi
IWDClientUser clientUser;
clientUser = WDClientUser.getCurrentUser();
IUser user = clientUser.getSAPUser();
user.getLatName();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.