cancel
Showing results for 
Search instead for 
Did you mean: 

Last login time of the user

Former Member
0 Kudos

Hi All ,

I want to get the last login time & Date of the user . But the SAP documentation says that these values are no more logged into the UME <a href="http://help.sap.com/saphelp_nw04/helpdata/en/43/bc6b9202454dece10000000a422035/frameset.htm"></a>

So what is the best way to get the date & time . Please give your suggestions.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Use this code

IWDClientUser CUser = WDClientUser.getCurrentUser();

IUser user = CUser.getSAPUser();

IUserAccount[] acc = user.getUserAccounts();

Date objDate = acc[0].getPreviousSuccessfulLogonDate();

Regards

LakshmiNarayana

Former Member
0 Kudos

Hi LakshmiNarayana ,

Did you try the code that you have provided ??. Those methods are deprecated now ..and UME is not storing the data .. If it works for you let me know.I have already tried it before posting in SDN .. it didn't work for me.

Former Member
0 Kudos

hi user,

as you can read in the API the code of LakshmiNarayana can not work ...

"get last sucessful logon date NOTE: This attribute is not automatically updated during login."

only idea i have: write your own JAAS login module and handle your lastlogindate issue there:

example:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4d65ed90-0201-0010-3aba-9209836e...

store it in db or use a singleton to retrieve it from your app.

Regards, Jens

raja_thangamani
Active Contributor
0 Kudos

Refer this link:

Raja T

Former Member
0 Kudos

Hi Raja,

Thanks for your reply . I have already searched SDN and gone through that link , but the problem is from SP16 these values are not logged in UME , if you know any better solution provide.