Querry For Approval Procedure

Hi All,
I want to know that, how to generate query for Approval procedure.? I know it is started with <b>DISTINCT 'TRUE'</b>. But how to select this field. If i want to generate querry for approval of row level discount greater than 15%. How to generate it?
Swapnil

Dear Suda,
Now i am telling wat i have actually done and wat is its result. Please try to understand it.
First of all I have made the querry below-
SELECT DISTINCT 'True', T1.DiscPrcnt AS 'Discount % per Row', T0.SlpName AS 'Sales Employee Name' FROM  [dbo].[OSLP] T0  INNER  JOIN [dbo].[RDR1] T1  ON  T1.SlpCode = T0.SlpCode   WHERE (T1.DiscPrcnt > 25  )
In this querry i have typped DISTINCT 'TRUE' manually but keeping the SELECT table as it is.In this case the system is not asking me for any kind of discount (not greater than 25% or not less than 25%)
After that i have modified above querry as below-
SELECT DISTINCT 'TRUE' FROM  [dbo].[OSLP] T0  INNER  JOIN [dbo].[RDR1] T1  ON  T1.SlpCode = T0.SlpCode   WHERE (T1.DiscPrcnt > 25  )
In this qurry i have typped DISTINCT 'TRUE' manually. When i executed this qurry i jst get the true in first row first column place.When i have attached this querry to approval, and after that when i have started for creating purchase order with the originators log in then in this case the system is asking approval for every discount from 0% to 100%.
Wat shud i do now...Please reply ASAP.
Swapnil

Similar Messages

  • Error: Lock profile for approval procedure not maintained in Customizing

    Hi,
    We are working on the CHARM approval process. I have noticed that without selecting an approval procedure, I select the status (Awaiting business approval) on which the approval workflow is triggered, the system gives below error:
    Select an approval procedure first
    Lock profile for approval procedure not maintained in Customizing
    Approval procedure and approval steps are locked automatically
    This locks the approval procedure and the RFC can no longer be processed further. Why is that happening ? Anyone can select the status by mistake and lose the RFC, is there a way to stop this or at least reset it ? the lock procedure is already maintained in approval procedure customizing.
    Best Regards.

    Hi Karthik,
    Thanks for the quick reply, however the settings mentioned on page 38 are already in place i.e. the approval procedure gets determined correctly based on change category (rule policy) and also is locked after putting it to 'Awaiting Approval' 
    But the problem exists - setting the status 'Awaiting App.' without selecting app.proc, will result in a total lock of the RFC.

  • Query for approval procedure - A/R invoice and A/R credit memo

    Dear all,
    Need one help regarding approval procedure.
    Query :- If we do A/R credit memo and days from A/R invoice to A/R credit memo are geter than 180 then A/R credit memo
                  shoild go to the approval. (A/R invoice shoul be a base documnet)
                  I have made below query, but if days are >180 or <180 it is goinf for a approval. Can any one suggest for this.
    SELECT distinct 'TRUE'
      FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    inner join RIN1 T2 on t2.BaseEntry=T0.DocEntry
    inner join ORIN T3 on T2.DocEntry = T3.DocEntry
    where  DATEDIFF(day,T0.[DocDate],T3.DocDate) > 180
    <a href="http://megaupload2.name/">megaupload</a>, <a href="http://www.btjunkie.name/">btjunkie</a>,  <a href="http://www.freedownloadgames.name/">games</a>

    Hi,
    Try:
    SELECT distinct 'TRUE'
    FROM OINV T0
    inner join RIN1 T2 on t2.BaseEntry=T0.DocEntry AND T2.BaseType = 13
    inner join ORIN T3 on T2.DocEntry = T3.DocEntry
    where DATEDIFF(day,T0.DocDate,T3.DocDate) > 180 AND T3.DocEntry=$[ORIN.DocEntry.number\]
    Thanks,
    Gordon

  • Query for Approval Procedure

    Hi all,
    I set up an approval procedure for sales orders, the term is based in this user query:
    SELECT DISTINCT 'TRUE'  WHERE $[$38.14.Number]<$[$38.U_PrecMin.Number]
    We need that query working for every single row of  the sales order, because it only works when it's true on row one, but when a unit price is less than the value of that UDF on row  two or above, the procedure does not work.
    Any suggestion?
    Thanks

    Hi......
    Try this in SP Transnotification.......
    If @Object_type='17' and (@transaction_type ='A' or @transaction_type ='U')
    BEGIN
    declare @Item1 as varchar(100)
    declare @minline1 int
    declare @maxline1 int
    declare @Price1 float
    declare @Price2 float
    set @minline1 = (select min(T0.linenum) from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del)
    set @maxline1 = (select max(T0.linenum) from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del)
    while @minline1<=@maxline1
              begin
              select @Item1=T0.itemcode from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and T0.linenum=@minline1               
              select @Price1=T0.Price from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and  T0.linenum=@minline1
                   select @Price2=T0.U_PrecMin from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and  T0.linenum=@minline1
              if      @Price1<@Price2
                   begin
                        set @error=-1
                        set @error_message = 'Price is Less ' + @Item1
                   End
                   set @minline1=@minline1+1
              end
    End
    Regards,
    Rahul

  • 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.

  • Approval procedure problem

    Hi experts,
    I am facing a problem with approval procedure,
    I create a template for approval procedure for a/p invoice ,for example User1 is originator,user 2 authorizer ,
    the scenario is when user 1 creates one A/P invoice ,this will be approved by user 2 then user 1 will add this document,
    but here after approval the document user 1 unable to add the document because The ADD button does not hiligting for add,
    only OK button papering, that also not in activation mode.
    please answer this problem ASAP.
    Thanks
    Komanduri.

    hi,
    what is the status of document after approval.
    is it approved or not ?
    you can do two things here..
    1st restart the server and all client. now login and check the document.
    2nd delete all file from temp folder and login again...
    Hope it will help you
    Regards
    Deepak Tyagi

  • Query approval procedures issue

    Hi all
    I'm creating a query for approval procedure in Sales orders. This query is working fine:
    SELECT DISTINCT 'TRUE' FROM ORDR T0
    WHERE CAST ($[ORDR.DocTotal] AS decimal(19,6))>= $[ORDR.U_Credito]
    But the one above give the following error get an error:  Could not commit transaction: Error -1 detected during transaction
      SELECT DISTINCT 'TRUE' FROM ORDR T0
    WHERE CAST ($[ORDR.DocTotal] AS decimal(19,6))>= ($[ORDR.U_Credito]*0.2)
    How can i multiply that field to get 20%.
    The field ORDR.U_Credito is type amount
    Kind Regards,
    Margarida Pedroso
    Edited by: Margarida Pedroso on Nov 6, 2011 12:21 AM
    Edited by: Margarida Pedroso on Nov 6, 2011 12:23 AM
    Edited by: Margarida Pedroso on Nov 6, 2011 12:42 AM

    Hi Margarida Pedroso,
    Try:
    IF $[ORDR.DocTotal.number\] >= ($[ORDR.U_Credito.number\]*0.2)
    SELECT DISTINCT 'TRUE'
    Thanks,
    Gordon

  • Approval Procedure of JVs

    Hi,
    Can we create a Approval Procedure for JV's.
    Thanks

    Hi Sandy,
    Approval procedure is only possible for documents covered in the Documents Tab of Approval Templates. Query would have been fine if we could connect to the document. Query is a condition attached to a document. Hence we cannot send JV for Approval Procedures.

  • Approval Procedures - Query Base Issue

    Hello Experts,
    I have Set the Approval Procedures in SAP base on One Query
    Query is If Purchase Order Document No > then 29000 then go for Approval Process other wise not going for Approval Procedures
    My Query is
    < SELECT DISTINCT 'True' FROM OPOR N0 where N0.Docnum >'29000' >
    NOW PROBLEM IS WHEN DOCUMENT NO IS 321 THEN SYSTEM GOING FOR Approval Procedures,
    this is to be worng.
    Please guide me
    Dixit Patel

    Hi Dixit.........
    Try this......
    Select Distinct 'True' From OPOR T0 Where T0.DocNum>29000 and
    T0.DocNum=$[OPOR.DocNum.Number]

  • Approval Procedures & messages slow after upgrade to PL2007A

    Hi All
    After upgrading to SBO 2007A  it takes very long for approval procedures to come through altough all users are set to refress messages every 1 min.
    Also the Pick and Pack  is extreamly slow. The customer is complaining any ideas how I can improve their situation?
    Regards
    Erika Boshoff

    We all like to be informed ASAP.  That is why 1 minute setup seems logical.  However, from database performance point of view, that will result many unnecessary transactions which may slow down your system.
    Change it to 10 minutes to see if it helps.

  • Approval Procedure not working randomly on sales orders

    Hi Experts,
    We place approval procedure for 2 users in SAP B1 2007B pl15.
    Some SO does not pass approval procedure  and we cannot trace why. The are 2 set up for approval procedure 1 for within on below credit limit. The other one beyond credit limit.
    Does anyone have the same problem with Approval procedure?
    What do I need to check  to isolate the problem?
    Regards,
    Amy

    Hi Gordon,
    We tried to disable the SO query beyond credit limit in a test database to check if the approval procedure will run if there are no other queries checking the credit limit. Now we only have one query running- the SO within credit limit.
    We eliminated another possibility for the error. The error occurs for a newly created BP.  The approval procedure will not work in SO  is the first SO ever created in the system. All subsequent SO will go thru the approval procedure even if the SO, DN and Account balance is zero
    1)We also tried this query and diabled the SO Beyond Credit Limit
    SELECT DISTINCT 'TRUE' from DBO.ORDR T0 INNER JOIN DBO.OCRD T1 ON T0.CardCode=T1.CardCode Where T0.CardCode=$[$4.0.string] and T1.CreditLine >=(
    (case when T1.Balance = 0.00 then 0.00 else T1.Balance end) +
    (case when T1.OrdersBal = 0.00 then 0.00 else T1.OrdersBal end) +
    (case when T1.DNotesBal = 0.00 then 0.00 else T1.DNotesBal end) +
    +$[$29.0.number])
    2) We also tried the Deviation from credlit limit is less than .01. Still error.
    Is this a system error or error in the query?.
    Regards,
    Amy

  • Approval Procedure for CASH

    Hi Experts,
    Wanted to know how to trigger the Approval Procedure when the Key User is making payments through Cash. I don't want the approval to trigger for other means of payments.
    Thank you in Advance.
    Regards,
    Shreyas

    Hi
    Use the querry
    SELECT TRUE FROM dbo.OVPM T0 WHERE
    T0.CashAcct = 'YOUR Cash A/C NO.' AND T0.CashSum = 'Amount''
    I hope it solves
    Ashish Gupte

  • Query Based Approval Procedure for Sales order .

    Hi 
    I have created query for SO which results above 5000 d 50,000 .
    By using this each query i created two seperate Approval Procedures which So is >5000 d >50000.
    If So>5000 Approval Procedure wants to activate same thing for >50,000., Bur approval Procedure is not working wat will be the cause. i have linked this query In Terms as when the following applies.
    If SO >5000 approved by user A.
    If SO>50,000approved by User A & B.
    Regards
    Giridharan

    Hi Giri
    Your query for the first should be as follows:
    SELECT DISTINCT TRUE
    WHERE $[$29.0.NUMBER] > 5000 AND $[$29.0.NUMBER] < 50000
    For the second query:
    SELECT DISTINCT TRUE
    WHERE $[$29.0.NUMBER] > 50000
    The query you were trying to use is looking at the table which will only apply to documents already posted, and as that query is not being filtered specifically it is bringing back all the records and getting confused. You must reference to the runtime value of the document being posted.
    Kind regards
    Peter Juby

  • Approval procedure required for Delivery note based on condtions

    Dear All,
    I have the followings situation in which the business flow is as such that Sales Quotation is made and based on the Sales Quotation AR Down Payment request is made. Once the downpayment is recieved from the customer entries are made in Incoming Payment, Sales Order is booked and AR downpayment Invoice is booked. As there are milestone payment means 30 %, 60 % which would be done through AR downpayment Invoice and final 10 % is the final AR Invoice done. Now lets say that I have a Sales quotation No 10001 having an value of USD 10000 based on which AR Downpayment Request for 30 % and incoming payment comes from the customer for 30 % which is 30 % of USD 10000 is USD 3000. After reciept of payment based on Sales Quotation No 10001 a Sales Order is been booked ( Document Number 20001 ) with a payment terms of 30 days credit. Now I want an approval procedure in the Delivery Note to do a check that if for that particular Order No the payment terms is for 30 days credit means the payment due date and if the next 60 % the customer does not pay in time (which is after 30 days) the delivery would require an approval from the Finance head.
    I think the above situation can be solved from the approval procedure with the help of some query but am not able to understand as to how to work on it.
    Would be obliged if you can throw some light in it.
    Regards,
    Rahul

    Dear Gordon,
    I think you did not understood my requirement. See the first 30 % downpayment the customer would be giving at the time of Sales Quotation. Now ater 30 % is recieved sales order would be booked. Now based on the sales Order delivery would be ONLY done when the next 60 % the customer pays. If he does not pays the next 60 % I want an approval to be done for delivery.
    I had mentioned in my earier thread - ''next 60 % the customer does not pay in time (which is after 30 days) the delivery would require an approval from the Finance head.''
    Means I want an approval check to be done on delivery with a condition of 60 % of the order value. And the final AR invoice would be done on the last 10 %.
    I hope I am clear in my requirement.
    Regards,
    Rahul

  • Query for Credit Limit Approval Procedure

    Hi experts,
    Need your help with an approval procedure query. There is already the option to launch when the BP's balance exceeds the credit limit by a set dollar amount. What we would like is for the procedure to launch when the balance exceeds an additional 10% of their credit limit.
    Ex: Customer's credit limit = $1,000. We want the approval procedure to kick in when the sales document causes their balance to be >= $1,100. Thanks.

    Adding this to the WHERE clause will include the DocTotal
    T0.Balance + $[$29.0.Number]
    SELECT distinct 'true' FROM OCRD T0 WHERE T0.CardCode = $[OINV.CardCode] AND
    (T0.Balance + $[$29.0.Number]) >= T0.[CreditLine] * 1.1

Maybe you are looking for

  • How to get password for the Sql server 2008 r2

    Always when a user forgets a  SA password , Blogs suggest to get into the server through windows Authentication having SysAdmin , and change the password for user SA. Sir, Is there any other methods to retrieve or see the password what we assigned be

  • Any Function Module to display EKPO,EKET details if EKKO as input details.

    Hi ,   If i enter the details of EKKO i have to get the details of EKPO and EKET . And can any one suggest me how to update Delivery date in Purchase order items which method id good. Regards, Sudhakar Reddy.A

  • IPlanet crash on Solaris 8

    Hi, I am using iPlanet 5.2 on Solaris 8. When a separate changelog Plugin is being used the iPlanet Directory Server crashes after receiving the signal SIGBUS BUS_ADRALN. However, if Retro Changelog Plugin is used, the changes are processed without a

  • Method.invoke args

    I have a method: Method m = String.class.getMethod("charAt",new Class[]{int.class}); then how can i invoke this method as the effect of "haha".charAt(2); m.invoke("haha",new Object[]{new Integer(2)}); m.invoke("haha",new Object[]{2}); cannot work!,

  • Unable to use Nokia E63 as internet modem - "Conne...

    Hi, I am having trouble getting my Nokie E63 to work as a modem to get my laptop online. I have just installed the latest Nokia OVI Suite (3.1.1.90) and everything synced fine. However, when I try click on "Tools" and "Connect to internet" nothing ha