cancel
Showing results for 
Search instead for 
Did you mean: 

Retreiveing Data for Particular employee

Former Member
0 Kudos

Hi Gurus,

Need some advice here. I'm developing a WD Appllication to display data from certain HR infotype in the portal. The data displayed in the portal should be ONLY for the logged on user (eg. if i log in the portal, i can only see my data from that infotype). I believe that 'onInit' i should be passing back the portal userID (using SSO, so it's similar with ECC) to ECC. In return the function module should cross check this with the personal number and then return the respective data form the infotypes.

Is this correct? If so, how do i actually pass back the userID to ECC? Thanks everyone

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The below code may helpful to you

//to get the portal logon user

public void wdDoInit () {

String user = "";

try {

IUser Iuser = WDClientUser.getCurrentUser().getSAPUser();

user = Iuser.getUniqueName();

} catch (WDUMException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

//execute function module

try {

wdContext.nodeY_Hr_YourBapi_Input().bind(new Y_Hr_YourBapi_Input());

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try {

wdContext.currentY_Hr_YourBapi_InputElement().setI_Uname(user);

wdContext.currentY_Hr_YourBapi_InputElement().modelObject().execute();

wdContext.nodeYourBapi_Output().invalidate();

} catch (WDDynamicRFCExecuteException e) {

manager.reportException(e.getMessage(), false);

}

}

and map your opuput node to your view

Regards

Suresh