cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Employee Number from Logon Ticket

Former Member
0 Kudos

Hello Everyone,

We have got a requirement. When we include a custom iview in to ESS portal we want to get hold of the username of the user that has logged in and pas it on to an RFC.

I would appreciate your help.

Regards,

PG.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser sapUser = wdUser.getSAPUser();

if (sapUser != null) {

IUserAccount[] acct = sapUser.getUserAccounts();

if (acct[0] != null) {

userId = acct[0].getLogonUid();

}

}

Hope it Helps

Regards,

Gayathri.

Answers (1)

Answers (1)

former_member185086
Active Contributor
0 Kudos

Hi PG

Use

String logonID = "";
 
		try
		{
 
			IWDClientUser wdUser = null;
			try
			{
				wdUser = WDClientUser.getCurrentUser();
			}
			catch (WDUMException e1)
			{
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
 
			// hängt an security.api.jar
			IUser user = wdUser.getSAPUser();
			logonID = user.getUniqueName();
 
		}
		catch (Exception e)
		{
			msgMgr.reportException("Error: " + e.getMessage(), true);
			e.printStackTrace();
		}

Hope it help u

Best Regards

Satish Kumar

Former Member
0 Kudos

Hi Satish,

Could you explain me in more detail about how to implement this scenario. I would appreciate your help.

Regards,

PG.

former_member185086
Active Contributor
0 Kudos

Hello PG.

1.You want to hold the current logged-in username and pas it on to an RFC.

2. In your Development Component add com.sap.security.api.sda.dc now u will able to work with UserAPI's

3 logonID = user.getUniqueName(); will give u current logged-in user.

4. Pass it to Rfc which require this input to process.

Hope it help you

Best Regards

Satish Kumar