on 04-24-2009 12:34 PM
Hi Experts
I am trying to create an Approval Process whereby any PO that is raised in a Currency other than the EURO will cross my desk.
I am having difficulty creating the SQL query necessary to isolate these Orders. Anyone able to help me?
Many thanks
Derek
hi,
SELECT Distinct 'TRUE' FROM OPOR T0 WHERE T0.DocCur ! = 'EUR'
Save query in query manager.
Jeyakanthan
Edited by: Jeyakanthan A on Apr 27, 2009 1:11 PM
Edited by: Jeyakanthan A on Apr 27, 2009 1:12 PM
Edited by: Jeyakanthan A on Apr 27, 2009 1:12 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Istivan
I did save the following as a Query and linked it to an Approval Process. However, as you can see below, I was getting errors.
If $http://OPOR.DocCur != 'EUR'
Select 'TRUE'
else
Select 'False'
But got Error: (1) incorrect syntax near OPOR.DocCur. and (2)...OCLG could not be prepared. I do not have the SQL skills to recognise the syntax problem?
Derek
hi,
Check currency is defined in Bp master data ?
Deleted activity related to purchase order & then have a try.
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Istvans query will work.
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
r u using 2005 or 2007 version ?
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is SAP B1 version & patch level ?
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
What is error message ?
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have u tested this query in demo database ?
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeyakanthan
I don't have Demo Database, merely copies of existing database for testing purposes.
Ref. the logic of the Query, should we not be trying to identify a PO where the currency is not = Euro.
I tried:
SELECT Distinct TRUE FROM OPOR T0 WHERE T0.DocCur ! <> 'EUR'
but was getting error message.
Any thoughts?
Derek
SELECT Distinct TRUE FROM OPOR T0 WHERE T0.DocCur != 'EUR'
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Derek,
Try this Query,
declare @curr nvarchar (10)
SELECT @curr = case (select T0.[DocCur] FROM OPOR T0 where T0.docentry = $[opor.docentry])
when 'EUR' then (select 'EUR')
end
if (@curr = 'EUR')
select @curr
This query will give capture if the currency of the BP is EUR in the documetn that is being added.
If it is true then you can pass this for Approval.
Set the Query based Approval procedure.
Regards
Reno
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry query will be like this
SELECT Distinct TRUE FROM OPOR T0 WHERE T0.DocCur != 'USD'
Now approval procedure will work.
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks again, Jeyakanthan. Making progress...
ran SQL: SELECT Distinct 'TRUE' FROM OPOR T0 WHERE T0.DocCur!= 'USD' . Result was TRUE.
When I then create PO in ANY currency, approval process kicks in. I only require approval process to kick when the Curency is not equal to EURO.
Derek
BTW I am very much a beginner in SQL so please bear with me......
hi,
Query will be like this
SELECT Distinct T0.DocCur FROM OPOR T0 WHERE T0.DocCur != 'USD'
Jeyakanthan
Edited by: Jeyakanthan A on Apr 24, 2009 5:15 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many thanks for coming back to me.
I created the SQL suggested. The result is GBP and USD.
The Approval using this SQL does not work.
Our Base Currency is EURO.
What I am looking to create is an approval process whereby if anyone tries to create a PO for USD or GBP, the PO will need to be approved by me.
Hope you can help.
Derek
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.