on 03-16-2012 1:30 PM
Hi,
I hope anybody can help me.
I´m trying to get the current User of a Web Dynpro in a Portal(NW 7.3).
For this I used the following code:
IUser user = null;
try {
user = WDClientUser.getCurrentUser().getSAPUser();
} catch (WDUMException e) {
wdComponentAPI.getMessageManager().reportException( "Failed to get current user: " + e.getLocalizedMessage(), true);
}
At building I get the error: package com.sap.security.api does not exist
According to other topics I added a variable in the Build Path with the com.sap.security.jar but I`m getting still this error!?
Thank you.
regards
Hi,
If you are building a WD DC on NW 7.3 then you shouldn't need to add anything to the build path - Web Dynpro DC's in 7.3 NWDS should have all of the correct WD libraries they need to access the Portal UME directly.
Older versions of the Portal (up to 7.0 I think) needed the com.sap.security api added (and to do that, you added them as a dependancy to the DC, not directly by editing the buildpath of your project.)
To get the User details from WD 7.3 try something like:
public String getCurrentSAPUser(){
try {
IWDClientUser user = WDClientUser.getCurrentUser();
String fullUser = user.getClientUserID();
String[] temp = null;
temp = fullUser.split(":");
String language = user.getLocale().getLanguage();
String sapUser = temp[1];
return sapUser;
} catch (Exception ex) {
logger.errorT("Failed getting SAP user");
return null;
}
This should be a decent starting point for what you are trying to do.
Gareth.
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,
Check this.
http://help.sap.com/saphelp_sm32/helpdata/en/29/575a421b5ec153e10000000a1550b0/content.htm
Regards,
Venkata S Pagolu
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.
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.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.