Skip to Content
avatar image
Former Member

Get current SAP Business one User as parameter for Crystal Report

Hi All,

I trying to get Actual logged User in SAP Business One as a Parameter for Crystal Report to filter information base on user

I can get correct user in query in SAP Business One using this query

SELECT Convert(int,$[USER])

I Try to create a Token

User@SELECT Convert(int,$[USER])  And that not working

I try User@Select USERID, U_NAME From OUSR

and i get list of users, So Token is working but not in the combine with $[USER] parameter

Any idea how I can do it?

I Using:

Crystal Report 2013

SAP Business One 9.0 PL11

Thanks in advance

Yoni

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 02, 2015 at 10:37 PM

    Hi,

    Please refer thread

    Thanks & Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

    • Try this query:

      Declare @User Int

      Declare @PriceList Int

      Set @User = ( SELECT T0.UserID FROM OUSR T0 WHERE t0.internal_K= $[user])
      Set @PriceList =

      Isnull((Select ListNum

        from OUSR X0

        Inner Join OUDG X1 on X0.DfltsGroup = X1.Code

        Inner Join OCRD X2 on X2.CardCode = X1.ICTCard

        Where X0.USERID = @User),3)

      Select T0.ItemCode, T0.ItemName,

        (Select OnHand from OITW Where WhsCode = '1' and ItemCode = T0.ItemCode) WHS,

        (Select OnHand from OITW Where WhsCode = '3' and ItemCode = T0.ItemCode) Office,

        T1.Price

      from OITM T0

        Inner Join ITM1 T1 on T1.ItemCode = T0.ItemCode and T1.PriceList = @PriceList

      Where OnHand > 0

  • avatar image
    Former Member
    Jan 02, 2015 at 07:19 PM

    You're looking for the UserCode@ token.

    Add comment
    10|10000 characters needed characters exceeded