Approval procedure in line discount

Hi Experts,
I would to ask if we can create an approval procedure when there are line discounts? If not, do we have any workaround query for this?
Thanks,
Don

Hi Deepak,
Thanks for the reply, but I assume that the terms and condition of the discount is only applicable to the discount footer and not on the line discounts. Can you check me on this if I'm correct?
Hi Yeni,
I am working on the query 'distinct true' however, the quey seems to be more advance since you have to capture all row discount % if any of the rows is not null. Do you have any specific query on this where I can also test?
Thanks.
Domn

Similar Messages

  • SBO - Approval Procedures at row level

    Does anyone know how to create an approval procedure that is triggered by a row field. For example if I want an approval procedure that verifies discount percentage in row level.
    There must be a workaround, cause I know this is not a functionality in SBO.
    Thanks,
    Hernán Baudrit

    The way you could solve this is to create a UDF at Header level and link a formatted search which loops through the number of rows in the transaction and returns TRUE if for example the Discount % is greater than allowed.
    The coding should be something as follows:
    Declare @Counter as integer
    Set @Couter = 0
    Declare @TempTable TABLE (STAT varchar(50)) -- Temporary table holding results of loop
    Declare @LoopFor as integer
    Set @LoopFor = (select (*) from (select T1.DocEntry
                                                              from INV1 T0 join OINV T1 on T0.DocEntry = T1.DocEntry
                                                                      where T0.DocNum = $[OINV.DocNum])
    While @Counter < @LoopFor
    BEGIN
          Declare @Disc as integer
           Set @Disc = ( select T1.DiscPrcnt
                                            from INV1 T0 join OINV T1 on T0.DocEntry = T1.DocEntry
                                                       where T0.DocNum = $[OINV.DocNum]) and T1.LineNum = @Counter
         IF @Disc > 20
         BEGIN
                  INSERT @TempTable VALUES ('TRUE')
         END ELSE INSERT @TempTable VALUES ('FALSE')
    @Counter = @Counter + 1
    END
    SELECT Distinct 'TRUE' from @TempTable where STAT = 'TRUE'
    Please note that the coding is not 100% accurate but should give you an idea of how to work around the problem.
    Next you should write a simple validation query on the value of the UDF to check whether it is set to 'True'.
    I hope this helps.

  • Approval Procedure should be triggred for discount given in line item

    Hi All,
    I want the approval procedure to be triggred when the discount given in the line item per row exceed 20%. Can any one give me the query for it .
    Thanks,
    Gopal

    Hi,
    There is any other option for it, pls help me
    I will explain the concept again.
    In Sale quotation if the discount % given in the line item greater than 20% then while posting the saleQuotation document the particular document should go for approval, else it should not trigger the approval.
    Its possible ? or any other aleternate solution  
    Thanks,
    Gopal

  • Help on Discount after Approval Procedures

    Hi Experts,
    Our customer is reporting an error after approval process that some documents has discount after the approval procedure.
    Our customer insist that there are no discount when they approved the PO/ or Ap invoice but after approval, the originator can no longer add the documnts due to discounts.
    Is there anybody experience the same problems with thier system.
    I cannot report this since I cannot simulate the error
    We are using 2007B Pl15
    Regards,
    Sandra

    HI Sandra,
    I agree with Gordon, I faced similar issues with the discount field but not with approval process though.
    This happens when Quantity and unit price of an item are entered and the line total gets populated automatically after this if the user changes the line total without deleting unit price or quantity the discount field gets populated according to the change in the line total, please check if the end user is doing any of this.....or similar changes in these lines.....
    regards,
    Murali

  • APPROVAL PROCEDURE THROUGH QUERY

    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

    Hi, Swapnil!
    You are on the right path, but I'm not sure if you can run this approval procedure at the line level.
    The queries you had are against the wrong table (RDR1 is a Sales Order table) and are missing the link to the active document. You have to add the reference to the active document or else you are pretty much querying against the entire RDR1 table.
    You need something like this:
    SELECT CASE WHEN ($[$38.15.Number] > 25) THEN 'True' ELSE 'False' END
    38 is the grid and 15 is the column for the discount.
    I tried a basic case and it didn't work. I think you need to loop through all the lines, but I'm not sure how to do this.
    You might have to create a header level UDF that changes automatically when the discount column changes, and has some logic to keep the highest discount you have on all the lines (something like: if discount greater than already stored value, update stored value) In the end, monitor this UDF for your approval procedure.
    Hope this helps!
    Liviu

  • Approval procedure if user change in the unit price at Purchase Order

    Dear Experts,
    I have defined purchase price list in the item master data. I want an approval if there is any devaition in the purchase price list and unit price which is defined in the purchase order. It will always go for the approval.
    Regards,
    Ravindera

    Dear Ravindera,
    Approval is only working on the header level. Unless you just care about the first line, no approval procedure can be built for other lines.
    You can block those PO by SP_TN instead.
    Thanks,
    Gordon

  • Query Approcal Procedure per line for SO

    Dear all expert,
    I would like to make query approval procedure that will tell user to ask approval every time they enter transaction that has gross margin < 0. This approval will work per line transaction. I mean if in line 1 has gross margin > 0 but in line 2, the gross margin is < 0, the approval procedures will run.
    Thanks for all your help

    Hi,
    AFAIK it's not possible to have query approvl on document lines, but only on document header or footer.
    Without using the SDK, I know no ways to achieve it.
    Regards,
    Eric

  • Approval Procedure in A/P Invoice

    Hi All,
    I want to create an approval procedure in A/P Invoice.
    Logic Behind this Approval procedure is GRPO and A/P Invoice should be done in the same month.
    If the A/P invoice month and Based GRPO month is different then A/P Invoice should go for approval.
    I have written a query but its giving error message. My query is like this :
    select case when (month($[opch.docdate]) <> (select month(OPDN.DocDate) from opdn where docentry = $[pch1.baseentry])) then 'true' Else '' End
    Can Anyone help me to write a proper query.
    Thanks
    Regards,
    Sumit Athare.

    Hi Sumit,
    B1 does not support approval queries on document lines. you can query only document header.
    you can either try to workaround it with all sorts of aggregate UDFs in the header, or alternatively take a look at:
    [http://www.beonesolutions.com/ip/Solutions/ap.html|http://www.beonesolutions.com/ip/Solutions/ap.html]
    all details, including the ability to query all document tables, are in:
    [http://www.beonesolutions.com/files/Approval_Pro_Brochure.pdf|http://www.beonesolutions.com/files/Approval_Pro_Brochure.pdf]
    Gilan

  • Approval Procedure Not Triggered on Updating Document

    Hi,
    When Adding a new Sales Order, if the document meets the criteria laid down by an Approval Template, the Approval Process is started.
    However, if an old Sales Order is Updated, the Sales Order the Approval Process is ignored.
    This is a problem for certain customers who have Approval Procedures which prevent users Adding Sales Orders which would take a Business Partner over the Commitment and/or Credit Limit.
    The user can get around the Approval Procedure by adding a Sales Order for a value which keeps the BP under the set limit.  If they then Update the Order, they can enter any value.
    For example, a user may be prevented from adding an Order totalling £1000.00.  If they Add the Order for £0.00 instead, they could later amend the Order to any amount as the Approval Process is not fired !

    Could you clarify what you mean by "The credit limit exceeded is in negative numbers"
    Negative number: the system message I get when I create a delivery note for a customer, exceeding the credit limit is the following:
    Customer has exceeded credit limit - 95.479 EUR
    Customer has exceeded commitment limit - 95.479 EUR
    Continue (Y/N)
    Make sure the Credit Limits are set in the BP Master. --> OK, credit limit is set to 100 EUR, Commitment limit to 100 EUR
    Also use Great than in Ratio and try to use a small number like 10 in the value  --> I am using 1 EUR
    Also, check in System Initialization > General Settings..BP Tab Activate approval procedure is checked. --> it is checked.
    Using the range option does not solve the problem, in fact even if I use 'Deviation from Credit Limit does not equal 1 EUR' the approval is not triggered. When I use the same Approval template, but I alter the terms to Total document greater than 1 or Discount% greater than 1 the approval is triggered.
    Edited by: Rui Pereira on Apr 29, 2009 1:19 PM

  • 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

  • Approval Procedure to change the price of items

    Hi!
    i 'm trying to create a query to an Approval Procedure to change the unit price in the Purchase Order  i create this query:
    SELECT DISTINCT 'True' FROM POR1 T0 INNER JOIN OITM T1 ON T0.[ItemCode] = T1.[ItemCode] WHERE T1.[ItemCode] = $[$38.1.0] AND T1.[LastPurPrc] <> $[$38.14.0]
    as you see this query compare is the Last Purchase Price is different than the actual unit price, and these for each line of item.
    I think this is correct, and i configure the Approval Procedure, but when i check the AP in the Purchase Order changing the Unit Price, it gets me an error that says
    1) [Microsoft][SQL Native Client][SQL Server] Error converting data type nvarchar to numeric.
    What happend?
    Am i doing something wrong ?
    In easy term, i just want to execute an approval procedure when the user change the unit price in the purchase order.
    Hope you can help me !
    Thanks in Advance
    Best Regards !

    Xavier,
    maybe you are with a problem thar you dont' know, i can to expain this point,
    1. if you want one approval at level line (comparing prices), not possible to make this way the approval, because you don't have control at level line while the document isn't in database.
    2. i bealeve that the better way is to make a store procedure for to insert each record into temp table while to add line in purchase order without (formatead seaches), now, when you create a purchase orden you need create a query for to search record in the temporal table with the condicion that you needed.
    3. now, if you want to call a value on the screen (money), the better way is $[$38.1.number]
    Good look,
    OSCAR KLENNER
    > Hi!
    > i 'm trying to create a query to an Approval
    > Procedure to change the unit price in the Purchase
    > Order  i create this query:
    > SELECT DISTINCT 'True' FROM POR1 T0 INNER JOIN OITM
    > T1 ON T0.[ItemCode] = T1.[ItemCode] WHERE
    > T1.[ItemCode] = $[$38.1.0] AND T1.[LastPurPrc] <>
    > $[$38.14.0]
    > as you see this query compare is the Last Purchase
    > Price is different than the actual unit price, and
    > these for each line of item.
    >
    > I think this is correct, and i configure the Approval
    > Procedure, but when i check the AP in the Purchase
    > Order changing the Unit Price, it gets me an error
    > that says
    > 1) [Microsoft][SQL Native Client][SQL Server] Error
    > converting data type nvarchar to numeric.
    >
    > What happend?
    > Am i doing something wrong ?
    >
    > In easy term, i just want to execute an approval
    > procedure when the user change the unit price in the
    > purchase order.
    >
    > Hope you can help me !
    > Thanks in Advance
    > Best Regards !

  • Approval procedure query help

    Hi there,
    at the moment i am creating an approval procedure. This should check if a sales man enter a price that is less than the price from the standard price list. If it is, it should check if the customer already got this price.
    If the customer got this price, there is no approval necessary. If the customer did not get this price, an approval procedure should be started.
    I started to write this query, ith the idea to check a sum of two price for the approval. But i get an error if i insert this query.
    DECLARE @x numeric(18,4)
    SELECT @x= (SELECT $[$38.14.])
    SELECT @x-T0.Price
    FROM ITM1 T0
    INNER JOIN OCRD T1 ON T1.CardCode = $[$4.0.0]
    WHERE T0.Pricelist = T1.ListNum and T0.ItemCode = $[$38.1.]
    Has anyone another idea or tips to solve my issue ?
    Regards Steffen

    Hi Gordon,
    thanks for your reply, i inserted your query and it works from the point, thats not possible to create a order with prices less than standard prices. The system gives this error message :
    Could not commit transaction '' (ADOC)
    I think, like Suda already explained, the problem is, that it is not possible to base approval on row lines.
    What do you think ?
    Thanks Steffen

  • Approval Procedure for Sale Orders

    Hi Experts:
    Anyone can help me?...I´m needing an Approval Procedure for Sale Orders to be activated whenever the user is trying to give diferent discount percentage from the one assigned in the price list throughout Period Discounts. We have Sap Business One 2007A SP01 PL05
    Thanks very much in advance
    CLAUDIA

    Hi CLAUDIA,
    This has to be done through user query approval.  However, since I don't have similar environment to try, you may start to create your own query first.
    Thanks,
    Gordon

  • Approval procedure triggers

    When a document is added where the total amount is less than an authorization template's limit, it can afterwards be updated with any amount higher than the amount requiring authorization. Unauthorized personnel can thus initiate a financial obligation for the company by adding purchase orders which is more than what is really needed, bypassing management's financial and logistical planning and budgeting.
    Suggested functionality:
    When a purchase order is added for less than the amount requiring auhtorization, and opened again,
    the system should also trigger the approval procedure when a new row amount is entered an test this total document amount against the applicable approval procedure and instead of just adding the document if it exceeds said amount, rather send it to the relevant person for approval as it would when creating a document from scratch which exceeds the allowed total document amount

    You should check you user Discount % in general authorization setup because if it filled by 100 then SAP will not ask for any type of Approval.
    And if your Client have statndard then setup in Approval setup using this (When the Following Applies) option.
    have you try standard procedure in SAP ?
    Try it and guide your client requirement in SAP is the best solution some time your question.
    I think it will work according your requirement.
    Thanks
    Manvendra

  • Approval Procedure - SAP loses the changes to the document

    Good morning to all.
    I need an explanation regarding the approval procedures.
    We have recently upgraded the system from version 2007 SP01 PL10 to version 8.81 PL10.
    We have a approval procedure whit 2 level:
    User A => Create the document
    User B => First level approval.
    If User B approve the document then
    User C => Final level approval
    I noticed that in the previous version, during the phase of approvals, was created a single record in the table ODRF. This record was updated with various changes made by users during the approval phase. The changes made ​​during the approval phase regarding UDF
    Now, with the new version, I find myself with the table ODRF registering a record for each change made to the document that is pending approval.
    So, if User B open the document pending approval, saves it as a draft, then edit some UDF and still saves as a draft, in ODRF table we have 2 line (the first for the first save, the second for the UDF edited and so on...)
    But, when you invoke the document itself to approve or modify it, it always loads the first record from the table ODRF, thus losing all the changes.
    Do you have news about this situation? Are there solutions?
    Sorry for my english...

    Hi GORDON.
    Thank for your reply
    After talking with our partners, I confirm that version 8.81 is not possible to make changes to the UDF fields in a document during the approval phase.
    More precisely, the changes can be made, the document can be saved as a draft during the approval procedure, but at the time of approval, the changes are not shown.
    This is because, in the drafts table (ODRF), unlike what happened in the 2007 SP01 PL10 and even in version 8.80, the changes are saved in other records (line) with other draft number ID respect to the original record, and therefore no longer recoverable and / or visible .
    And, I do not understand why, there is no trace in any official document about SAP to that change.
    Sono incazzato....

Maybe you are looking for