on 03-04-2010 8:24 AM
Hi Friend
One Supplier( Abc) Login into the portal . How to find it "ABC" user login into portal by using webdynpro with java
My requirement is
One Supplier login in to the portal that supper having one Vendor number ( it is fixed)
Exp: Portal user vijay login his vendor number 12345 like
Suppose u r login into the portal u have one vendor number like this
i have to desine one screen that is find PO'Status Screen, In that Screen, Meterial Group,line number,PO Status and Vendor number is avaliable.
Supplier login in to that portal he is finding some items.
this my Requirement. i m creating this screen ..How to fined user name from portal .once i have to find this user name by using webdybpro with java. I have to assine vendor number
Regards
Vijay
Hello Vijay,
You can get the current logged in user by following way:
1) Open Application Properties and set the sap.authentication property to true;
2) write following code in wdDoInit of your component controller;
try {
IWDClientUser l_clntUser = WDClientUser.getCurrentUser();
wdContext.currentContextElement().setCtx_va_loggedInUser(
l_clntUser.getSAPUser().getUniqueName());
} catch (WDUMException ex) {
wdComponentAPI.getMessageManager().reportException(
ex.getMessage(),
false);
}
This way you will get the user id and you can assign the vendor number as per business logic.
Abhinav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Friend,
wdContext.currentContextElement().setCtx_va_loggedInUser(l_clntUser.getSAPUser().getUniqueName());
How to get this "setCtx_va_loggedInUser(l_clntUser.getSAPUser().getUniqueName());"
After that wdContext.currentContextElement().setAttributeValue() like that can u give full explanation
starting to ending...Pls.....i need this is very importent.
Regards
Vijay
Hello Vijay,
You can wirte the following code to get the logged in user's ID
try {
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
IUser sapUser = wdClientUser.getSAPUser();
IUserAccount[] acct = sapUser.getUserAccounts();
String str = acct[0].getDisplayName();
wdComponentAPI.getMessageManager().reportSuccess("user "+ str);
} catch (WDUMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
You need security api for using it make sure that is present.
Thanks,
Hope this will help
Sarbjeet
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.