Approval Template based on Query

Hi All,
I want to wirte a query for defining approval templates.If any document (both on sales and Purchase side) is raised by a non-superuser,it should be sent for approval ,to the superusers ,before it is posted.
we have set approval templates for this.
But now,if the document contains the items with group code '101' ,then it should be sent for approvel to the superuser 'A' alone.(it is sure that in a single document items with different group codes will not be present).Others should be sent for approvel to superuser 'B'.
I know that this can be done only by using "Terms based on Queries" in approval templates.
I have never used this before.Can anyone help me with the query for this template?
Thanks& Regards,
V.M.Nivasini

Hi
The query is like this
SELECT T2.[ItmsGrpCod],T1.[ItemCode] , T1.[Dscription] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T2.[ItmsGrpCod] = 101
Create different queries for different Groups in where clause, Assign the query to respective Approver.
Hope this helps.
Regards
Reno

Similar Messages

  • Approval Procedure based on query

    Dear All,
    I'd like to make approval procedure based on query.  The condition is when the AP Invoice document created based on GRPO and there's a different Amount (AP Amount <> GR Amount) then it should trigger the approval procedure.
    Do you have any idea about the query structure?
    Thanks

    shobah,
    try this below query like this
    Select TRUE From OPCH Where DocTotal > 25000
    Jeyakanthan

  • Approval Template based on overdue invoices for a Region

    Hi,
    We have set an approval template for all overdue invoices which should go to the repsective sales managers for approval.
    We have setup two approval templates one for Central region and one for NES region.
    The template involves running of the following query and going to the respective manager for approval, however this does not work.
    When we create a seperate location wise approval template it works:
    Please check and let me know the error if any:
    SELECT DISTINCT 'TRUE'  FROM OINV T0 and OCRD T1 WHERE T1.CardCode =
    $[$4.0.0] and T1.U_AT_PC = 'NES' and T0.DocDueDate <= Getdate()  AND  T0.DocStatus !='C' AND $[ORDR.CARDCODE] = T0.CARDCODE
    Regards,

    Hi Gordon,
    Thanks for your reply!
    Actually, we had created the following query as per our requirement for all overdue invoices:
    SELECT DISTINCT 'TRUE'  FROM OINV T0 WHERE T0.DocDueDate <= Getdate()  AND  T0.DocStatus !='C' AND $[ORDR.CARDCODE] = T0.CARDCODE
    ( here the customer name in the order should be equal to the Invoice Table Customer code )
    and the location wise query:
    SELECT 'TRUE' FROM OCRD T0 where T0.CardCode =
    $[$4.0.0] and T0.U_AT_PC = 'NES'
    When i tried using this query with the Overdue invoice query the same order had to be approved by the manager twice, which is not acceptable.
    The problem in using the location wise approval template with the query, was that the "Confirm Credit Line Deviation" prompts up every time we try to enter a Sales Order.
    Whereas we wanted an alert to be prompted to the sales manager once any sales order is entered however if the SO is above the credit limit the sales manager should know about it, which can be achieved if we use the overdue invoice query correctly.
    I tried clubbing both the above queries together,but it doesn't work.
    Is there a way where you could use one query with an IF clause saying that if the UDF field is U_AT_PC= "NES" then go to NES sales manager if U_AT_PC="Central" then go to Central sales manager.
    Please revert
    Regards

  • Approval Templates: Inventory Transfer - based on Query (help)

    This is a newbie question but I don't have time to read or dig thru forum sorry.
    We have an Approval Template setup to alert/approve Inventory Transfers but it is set to Always on the Terms tab.
    We would like to modify it for only transfers into a certain set of warehouses).  How do i create a query that will determine the Warehouse Code (if warehouse code is:'WHL','ITL','RTL','WEB','CTO-WHL','CTO-ITL') on transfer and send the alert/approval notification.
    I know this has been done 1000 times over but please enlighten me.
    SELECT whsecode FROM wtr1 in ('WHL','ITL','RTL','WEB','CTO-WHL','CTO-ITL')

    Hi David......
    There are few Threads discussed on Forum that Approval Procedure for Row level is not possible. Ther may be some work around in doing this.
    You may search this post in forum as it is readily available........
    Approval procedure
    Regards,
    Rahul

  • Adding a query to the approval template

    Hello
    I'm trying to setup an approval template for AR Invoices based on a UDF.
    Basically I want to add a query to the approval template that will trigger an approval request based on the following query
    but i don't know how to set it properly.
    trigger an approval when:
    select * from OINV where u_ordertype = 'sub'
    any help would be appreciated it!
    Mike

    Hi Mike,
    Try this:
    select 'true' from OINV T0 where T0.u_ordertype = 'sub' and T0.DocNum = $[$8.0.0\]
    Thanks,
    Gordon

  • RE:Approval Templates Terms Based on queries (Requires Urgently plzzz ..)

    Hi You All,
    As per requirement we developed the small Addon which is attached to sales quotation & for that AddOn I need a approval which is on based userdefind query.I done this much of portation BUT as per standard. in Approval Template-Setup we have to select Document from Document Tab.but I dont have these std Document I need appproval on that developed AddOn
    Rgs,
    -Dinesh

    Hi Dinesh,
    U cannot find ur user forms in the standard approval list.
    Regards,
    Vasu Natari.

  • Approval Templates On Query Base Not working..

    hi.
    Plz have a look on uploaded image.
    here i had highlighted that no of approvals are required at approval stages form
    what is the meaning of 2 ,
    ->i think the  2 people approval we need compulsorily.  Am i currect.
    ->In approval Stages i added two persons but i given no of approval need 1
    what will happen . If any body one person will approve , will it approve the document am i currect.
    And one more thing In Approval template under terms i am using query based on this one
    the document should be approve if i give Doctotal total Greater than amount  working fine
    but i need query base approve..
    what i need while adding the sales quotation if project code is not empty
    it will take the approval
    select  t0.docentry from oqut t0 inner join qut1 t1 on t0.docentry=t1.docentry where t1.Project <>''
    the above scenarios i will check it..
    but i need your valuable suggestions...

    Thank u working fine..
    last Question plz reply to me.
    1)Is Approval Stages are unique means
    in approval template if i use one approval stage in another approval template can i use same approval stage  will it work...
    2) in approval stage
    Total authorization persons are 2
    The below scenarios i am able to add the document i can able to update it.
    no of approval 1
    no of reject 1
    what is the meaning
    if out of 2 persons if any body approve the document document will add
    if out of 2 if any one person reject then  the document will reject
    no of approval 2
    no of reject 2
    Two users should approve the document otherwise document should not be add
    Two users should reject the    document otherwise document should not be reject
    no of approval 2
    no of reject 1
    two users should approve the document otherwise document should not be add
    out of 2, one user should reject the document no need second users reject
    no of approval 1
    no of reject 2
    one user is enough
    two users need to approve the document
    Plz clarify my doubt.
    I am waiting for your reply..

  • Refreshing drop down list in a web template based on a query view

    Refreshing drop down list in a web template based on a query view  
    I have just developed my first set of portal pages displaying the results of Bex queries and query views in the SAP Netweaver portal. I developed the pages using web application designer. Each web template created with W.A.D is using a query or query view. In one template I have that is using a query view I am using a variable in my Bex query. This variable is of type customer exit, is set to variable is ready for input and calls some ABAP code which returns the current fiscal week number and year. When I run the query or query view in isolation through Bex analyzer the variables gets populated correctly. In my web template I have associated my variable from my query view to a drop down list box. However when I run the Iview created from this template the query results get refreshed but my drop down list box does not, it still shows last weeks week number. How do I get the drop down list box to refresh with the latest result from my customer exit variable?
    Regards
    Collin

    Hi  ,
    According to your description, my understanding is that you want to  filter a calendar based a look up column in SharePoint 2013.
    Calendar View not support OOTB filters connection. it is disabled for calendar view, you need to change view(not calendar view) so OOTB filters works and get connected to your view.
    You can achieve this using combination of jQuery and SharePoint OOB techniques.
    For jQuery filters refer to the  blog: enter SharePoint List Filters using jQuery
    Also you can filter Calendar View Web Part using JQuery and SPServices:
    http://blogs.visigo.com/chriscoulson/filter-a-sharepoint-calendar-list-with-a-date-picker/
    http://joshmccarty.com/2011/11/sharepoint-jquery-and-fullcalendar%E2%80%94now-with-spservices/
    http://spservices.codeplex.com/discussions/258846
    Another  way, you can have a look at the SPFilterCalendar :
    http://www.aasoftech.com/SitePages/How%20to%20Filter%20SharePoint%20Calendar%20Dynamically.aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Query for terms in approval template of approval procedure

    dears
    i need to write  a user query for approval template terms that chek for any price zero in invoice items .
    i tried the true query
    select 'true' from inv1 where $[inv1.price]=0
    however the invoice executed without asking for approval procedurs.
    any help will be appreciated!!
    talal

    Hi,
    Its not possible on row level Price.
    Try to Document total procedure, it will work.
    SELECT Distinct 'True'  FROM OINV T0 WHERE $[OINV.DocTotal]='0.00'
    Thanks,
    Madhan.

  • Different Web Template selection based on query selection values entered

    Dear Experts,
    We have a very unique requirement in our BI7 system.
    There is a web report which comprises of multiple queries and query views embedded in web templates. There are 2 selection parameters F1 and F2 that appear on executing the report.
    Our requirement is to display a unique web template to the user based upon his selections. If user enters values for both the fields F1 and F2 then we want to display report output from query views in web template T1.
    If user enters value for only field F1 and keeps F2 value blank, then we want to display report output from query views in web template T2.
    The problem we are facing is to decide the appropriate place where this type of condition could be coded. We do not think user exit would do the job here.
    Please help if you can.
    Regards
    XX

    Hi Pravin,
    Thanks for the reply.
    Let me please clarify my problem further.
    Web Template T1 --> Query Views V1, V2, V3.
    (All query views V1, V2, V3 have variables on fields F1 and F2).
    Web Template T2 --> Same Query Views V1, V2, V3.
    (All query views V1, V2, V3 have variables on fields F1 and F2 but this time variables would be having different values than above).
    If user enters values for both fields F1 and F2, then we want to display Template T1 with F1 variable = "value by user" and F2 variable = "value by user".
    If user enters value for only field F1, then we want to display Template T2 with F1 variable = "value by user" and F2 variable = "all values for which transaction data exist".
    Thus, we want to display a unique web template based on whether the value of F2 is entered by user or not.
    Please let me know if you need any further clarification.
    Thanks

  • Approval Template Query

    Hi, Is it possible to setup a approval template where an approval is required for all AP invoices that include a GL account that has a budget set for it?
    Thanks,
    Jane

    Hi,
    Yes possible to set approval template by means of query which is to be assigned under "Terms tab". But following condition should be meet,
    1. Under general settings--->BP tab, you have to select "Warning" check box.
    Thanks & Regards,
    Nagarajan

  • Approval Based on Query

    Hi,
    I want approval procedure for inventory transfer when my destination warehouse is 'ABM'
    I tried folowing 2 queries but not working
    SELECT 'TRUE' WHERE $[WRT1.WhsCode] = 'ABM'
    or
    SELECT DISTINCT 'TRUE' WHERE $[WRT1.WhsCode] = 'ABM'
    Please help
    thanks

    Let us take we have three warehouses
    According to this i have explained this
    Create one UDF on Header Level as To Warehouse
    SELECT 'TRUE' where $[$UDF]='warehouse1Code'
    SELECT 'TRUE' where $[$UDF]='warehouse2Code'
    SELECT 'TRUE' where $[$UDF]='warehouse3Code'
    Save this three quires.
    and select warehouse1 to warehouse1 user user defaults, same for 2 and 3.
    Go to Approval Stage and Create New Select the user as Warehouse 1 user
    Create same for 2 and 3
    1. Create Approval template 1 with orginaters 2 and 3 warehouse users. and stages as approval stage1 where warehouse 1 user is selected.
    Documents as Inventry transfer document.
    Terms Click on when the following applies.
    Quirey name Select the quirey name as  quirey with 1st warehouse
    Create for second and third warehouse as same.
    It will work fine for approval in inventory transfer.

  • Adding New Originator in Approval Template

    Hi,
    1. I initially created 5 users where when they create Sales Orders, they will have to go through the approval stage. The condition which was set is based on query. When I add additional users in the approval template to go thru this process, there's a message says 'No ratio has been defined'.
    What could caused this?
    2. After i add new users, do i have to reselect the query in able for them to go thru this approval process?
    Appreciate your help.
    Rgds,
    Harith

    Hi,
    When you Select the "When the Following  Applies" options you can view two windows below that option.
    In first Window, You can view the "Choose", "Term", "Ratio", "Value" Columns. In "Choose" Column you will find Check Box. In "Terms" Column you find Condition terms (ie,. like Deviates from budget, Discount% etc). In "Ratio" column  you find conditions like Greater Tha, Less than etc., In "Value" column you should give the  value based on which the condition works.
    When you Select the Checkbox then the corresponding Condition will be taken for Approval Procedure.
    In Second Window, "Terms Based on User Queries" You will select the query you have generated for approval process.
    If you are using Second Window you do not select any options in First window. You can view one of the option was selected after you have linked the query in second window.
    Raja.S

  • Related to approval   template

    hi
      i am using the sap 2005b with 36 patch
      i want to set the approval for particular condition and in that   approval there is one option  that is "terms based on user query"
    so i want save the query to that option. so what is procedure for that  please help me
    regards
    sandip

    Hi Sandip,
    1) Write a Query in Query Generator and save it.
    2) Then go to Approval Templates - Setup and in Terms Tab Click on when the Following Applies
    3) Under "Terms Based on User Queries" Double Click on 1st Row of the Matrix. It will open the Query Manager.
    4) Select the Saved Query and Double Click on it. It will automatically placed in that matrix
    if it helps you, give reward points.
    Thanks
    Sravan Kumar Pothu

  • Approval Template Not Working

    Hi Experts.
    I have activated approvals and have a simple approval template working (as a test) whereby AR Invoices exceeding a certain value require approval.
    I have also created an approval template whereby Purchase Orders require approval if they are over the users approval limit but under their manager's approval limit as defined in UDFs against the employee record.  This approval is not working.
    The approval is based on a query:
    select distinct 'true'
    from opor a, por1 b, oact c, ohem d, ohem e
    where a.docentry = b.docentry
    and a.canceled = 'n'
    and a.docstatus = 'o'
    and a.docentry = b.docentry
    and b.acctcode = c.acctcode
    and a.docnum = $[OPOR.DocNum]
    and a.ownercode = d.empid
    and d.manager = e.empid
    and (
         (b.u_budgeted = 'budget'and c.groupmask = 6
              and (a.doctotal-a.vatsum > d.u_budgetexpense or d.u_budgetexpense is null))
    or  (b.u_budgeted = 'budget'and c.groupmask = 1
              and (a.doctotal-a.vatsum > d.u_budgetcapital or d.u_budgetcapital is null))
    or  (b.u_budgeted = 'non-budget' and c.groupmask = 6
              and (a.doctotal-a.vatsum > d.u_nonbudgetexpense or d.u_nonbudgetexpense is null))
    or  (b.u_budgeted = 'non-budget' and c.groupmask = 1
              and (a.doctotal-a.vatsum > d.u_nonbudgetcapital or d.u_nonbudgetcapital is null)) )
    and (
         (b.u_budgeted = 'budget' and c.groupmask = 6
              and a.doctotal-a.vatsum <= e.u_budgetexpense
              and e.u_budgetexpense is not null)
    or  (b.u_budgeted = 'budget' and c.groupmask = 1
              and a.doctotal-a.vatsum <= e.u_budgetcapital
              and e.u_budgetcapital is not null)
    or  (b.u_budgeted = 'non-budget' and c.groupmask = 6
              and a.doctotal-a.vatsum <= e.u_nonbudgetexpense
              and e.u_nonbudgetexpense is not null)
    or  (b.u_budgeted = 'non-budget' and c.groupmask = 1
              and a.doctotal-a.vatsum <= e.u_nonbudgetcapital
              and e.u_nonbudgetcapital is not null) )
    The query will return the value 'true' if executed when the PO document is displayed on the screen, so I am happy with the query.
    I think maybe the problem might be on the Terms tab of the Approval Template because Total Selected Terms = 2.  I think this should be 1.
    There is a tick against Undefined Type under Term and I can remove this so that Total Selected Terms = 1, then I click on Update and OK - but when I go back in again the tick is back and Total Selected Terms = 2 again.
    Any suggestions would be very much appreciated.
    Regards.  Julie

    Hi.
    Thank you for your replies.
    The solution I worked out was to select the Term 'Total Document' as 'Greater than $1.00'.
    This enabled me to successfully de-select the last Term 'Undefined Type'.
    The Alert then fired successfully.
    Regards.
    Julie

Maybe you are looking for

  • My Creative zen vision M broke what do i do

    ok my Creative zen vision M 30 gb broke buti dont know how i turned it on this moring and the touchpad wasnt working so i was going to turn it of but right before i could to that a black screen comes up saying low baterry and truns of by itslef but i

  • How to query on User object in a workflow ?

    Hi experts, I want to email users 1 week before the password expired. For this Icreate a workflow in which I will query for the users who will expire in x days. My problem is that the field on which I want to query (Waveset Password Expiration date )

  • Migration from XMII 11.5 to XMII 11

    i am trying to find migrate from XMII version 11.5 to XMII version 11. can u tel the location in whsch the following will be placed. 1.Query Templates 2.Display Templates 3.Transactions 4.Schedulers 5.Web pages

  • How to set up transparent background in kdestopk?

    My goal is to put four different background image (wallpapers) on each face of my Compiz-Fusion cube. However, the Compiz wiki says that if kdesktop draws background already, it will cover Compiz's backgrounds. Then, I noticed that kdemod has this ht

  • Linksys Wireless WRT54G Stuck at 300kbs??

    SpeedTest.com Says Download  2.57MBS Upload 0.43MBS Can someone explain why the download speed is so slow? Im only getting like 300kbs max and now more  anyone know what is causing this??