on 07-08-2005 8:11 AM
Hi Experts,
I am running web dynpro application with authentication checkbox set. I want to display user id of the user in my application. I am using following code in Init method of component controller.
IWDClientUser wdUser = WDClientUser.getCurrentUser();
WdContext.currentContextElement().setUserName (wdUser.getClientUserID());
Here I am getting some integer value as userId.
I am not using Portals, so solutions suggested for portal are not useful for me .
Is there any way to get this uset id.
Thanks in advance
Hi ,
My problem is solved after adding jar file .
Thanks to all of u .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anton,
If your Web Dynpro application is a DC, you shouldn't copy any jar file. In the Web Dynpro Explorer, select your DC and navigate to DC MetaData > DC Definition > Used DC. Right click Used DC and choose Add Used DC. Select SAP-JEE > com.sap.security.api and click Finish. Possibly you can/should right click on your DC and choose Development Component > Sync Used DCs. Your project should build/deploy/run fine now.
If your Web Dynpro application is not a DC, you should first consider using DCs Or copy JDT\eclipse\plugins\com.sap.security\lib\com.sap.security.api.jar and put it in the lib directory of your Web Dynpro project. [For NW04s the location is IDE70\eclipse\plugins\com.sap.security_2.0.0\lib\com.sap.security.api.jar]
Kind regards,
Sigiswald
Hi Experts,
I am not getting method getSAPUser()and class IUser.
As per the earlier discussion on this topic, I understood that C:\Program Files\SAP\JDT\eclipse\plugins\com.sap.security\lib\com.sap.security.api.jar" file has to be added to classpath.
I have copied this file in 'lib' folder of my project but its not working . I have also tried by copying it in 'lib' folder of j2sdk folder. Exactly where this file needs to be copied
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
The thread suggested by valery would be of help. But in case you still have problems then this should get you the name of the logged in user.
IWDClientUser user = WDClientUser.getCurrentUser();
wdComponentAPI.getMessageManager().reportSuccess("User is "+user.getSAPUser().getUniqueID());
Hope that helps.
regards
ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a multi-step process:
1. Click "Search forum" https://forums.sdn.sap.com/search!default.jspa?forumID=52&threadID=50363
2. Enter your query as your question: only nouns should be left, join them by AND, so "How to get User Id in Web dynpro application" transforms to "User AND Id AND WebDynpro AND application"
3. For sure select date range "ALL"
4. Click search
5. Study messages found
If you repeat this sequence you get "Retrieving Web Dynpro User Info" as 3-d item. And the first reply by Karin Schattka answer your question along with several sub-sequent questions.
6. If you found nothing, post question
This is a universal approach to find answers on all technical forums.
VS
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 piece of code
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
if (user != null)
{
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
String strUserid = acct[0].getLogonUid();
wdContext.currentZtms_Fm_Regupdate_InputElement().setAssoid(new String(strUserid));
}
}
Note: Defining the IUser will show an error. To resolve this, within the properties of
the project, choose Java build path -> Libraries -> Add external jars ->
com.sap.securities -> lib -> com.sap.security.api. Open this file and retype the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe the Web AS UME can give you what you want:
http://help.sap.com/saphelp_nw04/helpdata/en/f5/4dd9d47a200d46bd1c56062f49e10b/content.htm
Here are the Javadocs for interface IUser:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/javadocs/nw04/sp12... management engine - version 4.0/com/sap/security/api/iuser.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dhanashree,
Try this snippet of code and tell me if it helps:
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
if (user != null)
{
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
String strUserid = acct[0].getLogonUid();
WdContext.currentContextElement().setUserName (new String(strUserid));
}
Regards,
shyam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
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.