Skip to Content
0

How to use current user login as a condition in Crystal Report

Jul 11, 2017 at 12:35 AM

410

avatar image

Hi Experts!

I just want to ask how a Crystal report be filtered based on the current user login in SAP B1. To give you an idea of the report, it pulls Incoming payment transactions (with Posting Date as parameter), but the output should only be seen by the User who entered the transaction.

Any ideas?

Thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

DIEGO LOTHER Jul 11, 2017 at 06:07 PM
0

Hi Carah,

There is a trick you can use:

Use sql command to retrieve your results, on sql command window add a new parameter called printbyusername@ like this:

This field brings the name of the user. U_NAME field from OUSR table.

After this, use the following instruction in your command to retrieve de user id.

DECLARE @UserId AS INT
SET @UserId = (SELECT INTERNAL_K FROM OUSR WHERE U_NAME = '{?printbyusername@}')

After this, user this variable @UserId in your where clause.

Hope it helps.

Kind Regards,

Diego Lother


img1.png (12.0 kB)
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 11 at 06:26 PM
0

Hi Diego,

I have Facing same issue . i want to get current user in crystal report which is login in SAP B1 and report show data according to current user login into sap system.

Share
10 |10000 characters needed characters left characters exceeded