on 06-14-2006 2:54 PM
I'm using the Adaptive RFC model.
The WD tutorials show how to connect an input field to an RFC input variable. This is not what I need to do. I need to pass the logged-in userid to the RFC to get all employee information about the logged-in user.
How do I pass the logged-in user value to the RFC prior to execution? What is the syntax, and where do I need to put the code in the "implementation" (right before the execute)?
Thanks,
Kevin
Kevin,
You don't have to map the RFC to the UI elements.
Simply use the following code to get the logged in userID.
// get the currently logged in user
IWDClientUser wdUser = WDClientUser.getCurrentUser();
//get the com.sap.security.api.Iuser; It is null in case wdUser represents an anonymous user
IUser user = wdUser.getSAPUser();
//check whether the user is anonymous
if (user != null)
{
//access logon ID by iterating through the IUserAccount array
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
String strUserid = acct[0].getLogonUid();
//pass the value obtained from the portal to value attribute
}
}
Set the userID to suitable the RFC attribute like this:
wdContext.current<<i>RFCNode</i>>().set<<i>Attribute</i>>( strUserid));
and execute the RFC to get the desired result.
Bala
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 | |
10 | |
7 | |
6 | |
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.