Skip to Content
avatar image
Former Member

Retreiveing Data for Particular employee

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 26, 2007 at 03:48 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 26, 2007 at 06:55 AM

    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

    Add comment
    10|10000 characters needed characters exceeded