Skip to Content

List of User SAP B1

Dear Expect,

I generated query to displayed userid, name, status, creation date, last login date, user group and role.Why certain information i couldn't get example

creation date and status. How to pull out user role and group?

SELECT T0.[USER_CODE], T0.[U_NAME], T0.[lastLogin], T0.[createDate] FROM OUSR T0

Please help.

Thanks,

Saufil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 19, 2015 at 04:49 AM

    Hi Saufilbadli,

    1. For Creation Date, we can get it, and you have done it correctly by referring to T0.[CreateDate]. You will get creation date from that. However, please note that if you run the query in demo database, the create date field is empty for all existing users like manager(Jayson Butler), etc. You have to create a new user manually and then the CreateDate field of that new user will have value.

    2. I don't understand what do you mean by Status, Role, and Group, could you elaborate more with screenshot which field do you mean?

    Regards,

    Wongso

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Saufilbadli Ya'cob

      Hi Saufilbadli,

      1. If you want to query which license type is assigned to which user, it is not easy. You can find information about that here https://scn.sap.com/thread/2089180

      2. If you want to query which group is assigned to which user, it is easier. You can use a query like this:

      SELECT T0.USER_CODE, T0.U_NAME, T0. USERID, T2.GroupName

      FROM OUSR T0

      LEFT JOIN USR7 T1 on T0.USERID = T1.UserId

      LEFT JOIN OUGR T2 on T2.GroupId = T1.GroupId


      Regards,

      Wongso