cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the current User Name and stored in which table

Former Member
0 Kudos

In which table the current user name (Login) is stored?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

To find current user, using $[user\]. All user names stored in OUSR. No other tables.

Thanks,

Gordon

Former Member
0 Kudos

please could you write the full query for finding the current user?

I tried the following query

select $[user] from OUSR

But i am getting the output as

0.00

0.00

0.00

Edited by: Mohanapriya Jayakumar on Nov 27, 2008 9:09 AM

Former Member
0 Kudos

Hi

Document Owner is current user right. why dont you use it?

regards

Former Member
0 Kudos

select U_Name from dbo.OUSR where UserID = $[user\]

Former Member
0 Kudos

I tried this in Query Generator, but i am getting the following error

' Incorrect syntax near 'user''

Former Member
0 Kudos

Try this one:

select T0.U_Name from dbo.OUSR T0 where T0.UserID = $[user\]

This query will not run in query generator. You have to save it and run when you have windows open like Sales Order.

Thanks,

Gordon

Former Member
0 Kudos

Hi Mohanapriya

The query provided by Gordon can not run on query generator as the $USER is a runtime variable.

You need to save it to a query then use it in a FMS(Formatted Search.)

Just open a form(ex:sales order ), click the field in which you want to show the user name,

then press ****+F2 or Tools->Search Function->Define,

Search by Saved query,then assign the save query to the field.

After that ,you can run the FMS(shift+F2) to get the current user info.

Regards,

Syn Qin

SAP Business One Forums Team

Answers (0)