on 07-30-2009 9:05 PM
Oi
Estou precisando comparar em uma consulta SQL se o usuário que criou um determinado documento é o usuário que está logado no momento. Existe alguma forma no SQL, alguma função que mostre quem é o usuário logado no momento?
Obrigada,
Luciana Amorim
Luciana, você consegue buscar o usuário atual usando a string: $[USER]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Boa tarde,
Testei a solução da nota número 672983 no B1 9.0 e não funcionou, alguém sabe como fazer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oi
A obtenção do usuário que está criando o documento é possível através uma busca formatada.
A nota SAP 672983 descreve isso.
Mas obter através de uma query quem esta logado numa estação isso não é possível uma vez que esse valor não se encontra numa tabela enquanto o usuário trabalha de uma forma global no sistema.
Paulo Calado
SAP Business One Forums Team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Boa noite, você encontra no link abaixo.
Guarde o link, só mude o numero da nota no final do link pra outras notas.
https://websmp206.sap-ag.de/sap/bc/bsp/spn/smb_searchnotes/display2.htm?note_langu=E¬e_numm= 672983
Masss, infelizmente não funciona mais (testei no SAP 8.81 PL10 e agora uso o SAP 8.82 PL5).
Abs
Fabio.
========================================================================
Symptom
How can the current User or the current Posting Period be displayed in the application.
Cause
Consulting
Solution
In order to display the current User or\and Posting Period in a query the following syntax has to be used:
For the current User logged in :
$[user]
For the current Posting Period:
$[PERIOD]
With those indexes the system retrieves the internal key of the requested value. In order to retrieve the descriptive value the following queries can be used:
For the current User:
SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER]
For the current Posting Period:
SELECT T0.Name FROM OFPR T0 WHERE T0.AbsEntry = $[PERIOD]
As the retrieve value is the current one the value returned is different if the query is run by different users or during different posting periods.
That is to say that if the query is first run when user A is logged then the query result is A. If the query is run when user B is logged the result is B.
When the Posting Period changes the value retrieved is also changed.
Note: the above query cannot be executed from the Query Generator or Query Manager but from Tools-> Queries->User Queries.
Other terms
Formatted Search, FMS, User Queries, user, Posting Periods, SAP Business One
Header Data
Released on | 07.03.2010 09:30:41 | ||
Release status | Released for Customer | ||
Component | SBO-GEN-FMS Formatted Search | ||
Other Components |
| ||
Priority | Recommendations/additional info | ||
Category | Consulting |
Validity
|
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.