Skip to Content
avatar image
Former Member

How to access User account validity date

Hi Experts,

How can we update the user account attributes (like Validation to and from, account locked etc..) stored in UME api's programmatically through Web dynpro java?

Kindly assist.

Best Regards,

Upasna

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 09, 2016 at 01:53 PM

    Hi Upasna,

    it is possible through UME APIs (com.sap.security.api.jar). create a project in NWDS and com.sap.security.api.jar   jar file to the classpath.

    Use the below code to get and set UME attribute values.

    try

    {

         String userID = WDClientUser.getCurrentUser().getSAPUser().getUniqueName(); 

         IUserAccount userAcc = UMFactory.getUserAccountFactory().getMutableUserAccount(userID);

       

    //get values

          String validfromdate = userAcc.getValidFromDate();

         String validtodate =  userAcc.getValidToDate();

          boolean lockstatus=  userAcc.isLocked();


    //set values    

           userAcc.setLocked(true, 1);

           userAcc.setValidFromDate(Date arg0);

           userAcc.setValidToDate(Date arg0);

    }

    catch(Exception e)

    {

         e.printStackTrace(0;

    }

    Add comment
    10|10000 characters needed characters exceeded