cancel
Showing results for 
Search instead for 
Did you mean: 

Windows Username

Former Member
0 Kudos

How to retrieve 'Windows Username' in Webdynpro application?

Thanks & Regards

V.Das

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you wish to get the client's username :

import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;

import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;

try{

IWDClientUser user = WDClientUser.getCurrentUser();

} ...

String firstName = user.getFirstName();

String secondName = user.getLastName();

if you wish to get local name :

InetAddress.getByName("localhost").getHostName();

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I don't think you can get access to the windows user name from a WD application. That's because of security reasons.

I would have suggested System.getProperty("user.name") if it was a stand-alone java app, but in WD that's not going to work. I think it will return the SAP service name.

Regards,

Satyajit.