Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get the User who is not using user id from past 30 days

Former Member
0 Kudos

Hi All,

I need to get the User's who is not using their user id's which we have created in SU01from past 30 days.

I tried to get based on Last log on date from USR02 table.I got the users but i am not able to get who is not using from past 30 days.

Is there any FM to get the user's who is not using their user id's from pass 30 days.

please this is very urgent .I will reward points.

Thanks,

Swapna.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Swapna,

In table USR02, there is a field TRDAT (Last Logon Date). You can query the table for WHERE condition where

USR02-TRDAT less than SY-DATUM - 30.

This should give you the result.

Also, if TRDAT is 00.00.0000 - it implies user has not logged on @ all then you check the "Creation date of user master record" field USR02-ERDAT, if that is less than SY-DATUM - 30, then that user also satisfies your condition.

Regards,

Aditya

Edited by: Aditya Laud on Jan 16, 2008 2:53 AM

Edited by: Aditya Laud on Jan 16, 2008 2:55 AM

7 REPLIES 7

Former Member
0 Kudos

Hi,

you can see the last login-date in usr02-TRDAT

regards

Nicole

Former Member
0 Kudos

Hi Swapna,

In table USR02, there is a field TRDAT (Last Logon Date). You can query the table for WHERE condition where

USR02-TRDAT less than SY-DATUM - 30.

This should give you the result.

Also, if TRDAT is 00.00.0000 - it implies user has not logged on @ all then you check the "Creation date of user master record" field USR02-ERDAT, if that is less than SY-DATUM - 30, then that user also satisfies your condition.

Regards,

Aditya

Edited by: Aditya Laud on Jan 16, 2008 2:53 AM

Edited by: Aditya Laud on Jan 16, 2008 2:55 AM

Former Member
0 Kudos

Hi,

Maybe the following ABAP program can be useful to you

RSUSR200 List of Users According to Logon Date and Password Change

Regards

Former Member
0 Kudos

HI Adithaya,

Thanks for u r answer.But when i am writing the query select trdat from usr02 where trdat le sy-datum - 30.It is giving me eroor like Eroor in logical expression.

Can you solve this problem.

Thanks,

Swapna

0 Kudos

Hi Swapna,

Please create another variable e.g. V_datum type SY-datum.

v_datum = sy-datum - 30.

Then use this in the where clause i.e.

WHERE TRDAT LE V_DATUM.

SAP (for now) does not allow us to perform calculation in logical expression.

Regards,

Aditya

0 Kudos

Hi,

Move the value (SY-DATUM - 30) to a variable and use in SELECT statement.

BTW, Have you checked the program provided by Jurgen. Execute the program with No.of Days since last logon as 30.

It should server your purpose.

Kind Regards

Eswar

0 Kudos

Hi,

try it like this =>

data: ddatum like sy-datum.

ddatum = sy-datum - 30.

select * from usr02 where trdat le ddatum. endselect.