cancel
Showing results for 
Search instead for 
Did you mean: 

Currently Logged in User

Former Member
0 Kudos

Dear Experts

i would like to know that how can we get the currently logged in user through query or some other option, as i want to generate different document series for every single user.

Secondly, if i have a party which is my customer as well as my vendor, how i can perform netting so as to get the recievables and payables for the particular party.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

SELECT T0.U_NAME FROM OUSR T0 WHERE T0.INTERNAL_K = $[USER]
Former Member
0 Kudos

Thanks Sri

I appreciate your prompt reply, im using 2007 A version PL 42

The query is not returning any result.

Please also tell me about customer/vendor netting. how can i net off recievables and payables if the a particular business partner is my customer and also my vendor

Former Member
0 Kudos

Dont Execute the Query using 'Query Manager' rather execute by assigning the query to a Field as FMS.

Former Member
0 Kudos

Thanks for your prompt reply.

Kindly tell me about the business partner netting, if the BP is a customer and vendor, how to net off its accounts. is there any option available in SAP B1

former_member204969
Active Contributor
0 Kudos

To connect the customer and vendor, set the payment consolidation in the business partner master data under the accounting tab, and select the connected vendor/customer.

Former Member
0 Kudos

The consolidated BP option is only applicable to either a customer or a vendor. We cannot select customers in vendor record or vice versa. Please do check it before post a thread.

Answers (4)

Answers (4)

rashantha
Participant
0 Kudos

Yes, Cameron. I have to create UDT to keep track of the employee, which I will be able to use as a variable in queries. This came from Ben Grassi it kinda works. Hopefully I can work on this next month.

SELECT CardCode, CardName, OCRD.SlpCode
FROM OCRD
LEFT JOIN OHEM ON OHEM.salesPrson=OCRD.SlpCode
LEFT JOIN OUSR ON OUSR.USERID=OHEM.userId
WHERE OUSR.USER_COde=(select top 1 UserCode from USR5 where SessionID = @@SPID and Source = 'SBO_Client' and Date < GETDATE() order by Date desc)
rashantha
Participant
0 Kudos

I get this error when I try the above in SAP B1 9.3

[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'USER'. 2). [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Statement 'Blanket Agreement' (OOAT) (s) could not be prepared.

cyoder
Discoverer
0 Kudos

were you able to find a solution, Rashantha? I am also running into the same issue on B1 9.3 PL 06.

Thanks,

Cameron

Former Member
0 Kudos

Thanks Sri

Former Member
0 Kudos

Hi,

One way to get current logged in user list is through the XML file on the licensing server. Otherwise, you can get current user by

Select T0.U_Name From dbo.OUSR T0 Where T0.UserID = $[USER\].

What is your B1 version and PL? It may not be the same for 2005 or 2007 to handle those BP with both types.

Thanks,

Gordon