cancel
Showing results for 
Search instead for 
Did you mean: 

get the sy-uname from SAP system

Former Member
0 Kudos

dear all, i use the following codes to retrive the system username

IWDClientUser wduser = WDClientUser.getCurrentUser();

IUser user=wduser.getSAPUser();

String username = user.getUniqueName();

i already add the required com.sap.security.api.jar into the project path.

but stil i get the error said unhandled exception type WDUMExeption,i got the red underlined at WDClientUser.getCurrentUser();

any idea? or any other way to retrive the username in sap? thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI

Try the following Code

IUser currentUser = null;
		try {
			currentUser = WDClientUser.getCurrentUser().getSAPUser();

			WDClientUser.getCurrentUser().getSAPUser();

		} catch (WDUMException e1) {

			e1.printStackTrace();
		}

Regards

Chaitanya.A

Former Member
0 Kudos

Hi Joan,

<b>try

{

IWDClientUser wduser = WDClientUser.getCurrentUser();

IUser user=wduser.getSAPUser();

String username = user.getUniqueName();

}

catch(Exception e)

{

}</b>

Put the code in try catch block as the getCurrentUser method throws WDUMExeption and needs to be handled in the calling function.

Regards,

Murtuza