on 05-05-2010 4:30 PM
Hello
I wrote the following query for purpose of returning open quotes for the following day for the person logged into SAP.
I'm having an issue with: T3.INTERNAL_K = $[user]
It keeps coming back with a "service contracts" error. can I not use this variable within this query? any suggestions on modify it?
I don't want the user to have to enter any variables
SELECT T0.[U_SalesEmployee] AS 'Sales Employee', T0.[U_Create] AS 'Created', T0.[U_NumLevel] AS '#Levels',
T0.[U_Customer] AS 'Customer', T0.[U_CardCode] AS 'CustId', T0.[U_NumAtCard] AS 'Cust Ref/PO', T0.[U_Type] AS 'Type',
T0.[U_Status] AS 'Status', T0.[U_SubEnd] AS 'Expires',T0.[U_CntctPrsn] AS 'Contact', T0.[U_TotalPrice] AS 'Total Price',
T0.[U_SubNum] AS 'Quote #' FROM [dbo].[@LBSISUBH] T0 (nolock)
join OCRD t1 on T0.U_CardCode=t1.CardCode
join OHEM t2 on t1.SlpCode=t2.salesPrson
join OUSR T3 on t2.userId=T3.USERID
WHERE T0.[U_Type] = 'Quote' and T0.U_Status = 'Open' and
T0.U_NumLevel > 0 and (convert(varchar, T0.[U_create], 1) = convert(varchar, getdate()-1, 1))
and T3.INTERNAL_K = $[user]
order by T0.U_SalesEmployee, T0.U_Type, T0.U_TotalPrice
Have you tried to query OQUT table directly?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The $[USER] reference is valid only in the context of a document, that is in an FMS. Starting from the query manager it gives syntactic error.
Edited by: István K#rös on May 10, 2010 4:51 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You may try some other system tables to find out if it is UDT related.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gordon
What table is that?
I have no data in it
thanks
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
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.