cancel
Showing results for 
Search instead for 
Did you mean: 

Query that can retrieve data according to user currently login

Former Member
0 Kudos

Hi All,

I have a query that will get the the 'Doctotal', 'DocNum', and 'Docdate' from oinv

The requirements are the following:

1. I have two users, UserA and UserB

2. If UserA is currently login, the query will retrieve the data according to her login. And not supposed to see the sales of UserB.

3. If UserB is currently login, then vice versa.

rgds,

vin

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

If you use crystal report, you need to add usercode parameter to the selection formula.

But if you just use it in query, as stated, you can get the current login user data in a formatted search that you run in an active document.

Hope it helps

former_member204969
Active Contributor
0 Kudos

A query activated from the Qury Manager does not get the information who activated it.

The $\[user] returns the code of the actual user only if it is executed in a formatted search! (Or if you activate it by the Tools/Queries/User Queries menu when a document is active). It does not get the identifier value if the query is activated from

the query manager.

So if you want your query dependent on the activating user, you should activate it as an FS (or the above mentioned manner).

Former Member
0 Kudos

You can try:

SELECT T0.Doctotal, T0.DocNum, T0.Docdate from oinv T0

INNER JOIN oSLP T1 ON T1.SlpCode = T0.SlpCode

WHERE T1.UserSign= $[user\]

Former Member
0 Kudos

Hi,

Are they sales employees or document owners?

Thanks,

Gordon

Former Member
0 Kudos

Hi Gordon,

It's sales employee, thanks

Former Member
0 Kudos

Hi Melvin.......

Does Use A and User B have same login User Code into SAP or they have Different User Codes with differnt licenses?

Regards,

Rahul

Former Member
0 Kudos

Hi Rahul,

They have individual user code and license. thanks

rgds,

vin

Former Member
0 Kudos

Hi Melvin.....

If you want sales Report to be executed as per users then you can predefined the reports where you can hard code his ID and give authorization see such reports by the login person.

This can be achieved by General Authorization.....

Regards,

Rahul