Approval procedure should trigger on PO updation

Hi,
After adding the Purchase Order, i will do some changes on the same PO.
Approval procedure is required updation or changes in the same PO.
any one can suggest me.
Regards,
Vikram

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(25),     -- SBO Object Type
@transaction_type nchar(1),   -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
begin
-- Return values
declare @error  int    -- Result (0 for no error)
declare @error_message nvarchar (200)   -- Error string to be displayed
select @error = 0
select @error_message = N'Ok'
-- ADD YOUR CODE HERE
IF (@object_type=22)            -- 22 for Purchase Order
BEGIN
if (@transaction_type='A') or (@transaction_type='U')    -- A  For Add and U for Update
BEGIN
--     ADD     YOUR     CODE     HERE
END
END
-- Select the return values
select @error, @error_message
end

Similar Messages

  • 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

  • Approval procedure when update sales order that hasn't been approved

    Dear Experts
    I need some advice
    Example:
    - BP credit limit = 100
    - Create New Sales order with amount 90, doesnu2019t need trigger approval procedure, because the amount is still under limit
    - Update the SO amount to be 110, approval procedure should be triggered
    But in SBO, approval procedure is not triggered for update transaction even for SO has not yet been approved, is it a bug? Will it be improved in SBO 8.8?
    Is there any other way to trigger approval procedure in update mode? May be through store procedure or add on?
    Really appreciate your help
    Best Regards
    JeiMing

    Dear Gordon
    I understand the concept for approval will not be triggered anymore for approved SO, because once a transaction has been approved, user will not be allowed to make any changes that related with the approval. And SBO has been made restriction for that. It is good
    But, It doesn't make sense, for SO that even the approval has not been yet executed. And SBO still allow user to make any changes such as quantity and total amount. And SBO do not trigger the approval if the modification meet approval condition
    If SBO was designed not trigger approval in update mode  to avoid endless loop as what you said, why SBO still allow user to make any changes in unapproved SO ? it makes user can avoid the approval
    Don't you think this is a bug ?
    Please advice
    Best Regards
    JeiMing

  • Fix Approval Procedures to work on Update

    I opened a ticket with Support concerning the condition where a user who is subject to approval procedure can circumvent the approval process using the Update process. Support suggested I post my recommendation here.
    Say a user is subject to approval procedure whenever they post a Purchase Order above $1000.  Today a user can create a PO for less than $1000 (which doesn't trigger an approval). Next they Update the PO so that the document total is greater than $1000. On Update, NO approval procedure runs. Support said this is current functionality.  This is a huge hole in the approval functionality that makes it practically useless when a user knows it's this easy to circumvent.  Support said this issue was previously reviewed and decided not to fix it.  I'm suggesting that it's imperative this is fixed.

    Agree. The approval procedures are completely useless as it is far too easy for the user to work around them.
    Our risk & Governance department has reviewed SAP Business One and handed out a very bad report because of a few holes in the system.
    We currently use the system for our subsidiaries and it nearly fails every single test executed by the auditors.
    1) Approval procedures must work for an update process (this would fix 80% of the issues).
    2) It must be capable of identifying critical and non critical fields (such as the bank account on the supplier record).
    Vincent

  • Query that will run on the items matrix and trigger Approval procedure

    Hello,
    We are trying to design an approval procedure whenever an item code appears in a certain UDT.
    For example, we have many items in OITM.
    We have 50 of those items also in @BIN.
    The approval procedure should be triggered only when the document lists one of the items that appear in @BIN.
    I am using the following query:
    SELECT 'TRUE'   where $ [$38.1.0]  IN (Select code from [@BIN] )
    The problem is that the query would only search on the first row and wouldnu2019t continue to the next rows.
    Do you have any idea how to bypass this limitation?
    Thanks in advance
    Revital
    SELECT 'TRUE'   where $[$38.1.0]  IN (Select code from [@BIN] )

    Hi Revital,
    One way to implement this functionality would be to use a UI API that verifies the values while filling the items in the Matrix. For this you would need a little programming knowledge but no extra license.
    There is a lot of information including Code Samples in the SDK Package delievered with every patch of Business One.
    Kind Regards,
    Friederike Mundt

  • Two Steps Approval Procedure

    Dear Experts,
    I want to set approval Procedure for Purchase Order
    If the document total is less than or equal to 50000, the approval procedure should only trigger to Unit Head.
    If Document Total is greater than 50000, it should first go to Unit Head , then HO Head and then finally to DGM Purchase .
    Please Help!!!!
    Thanks
    Taruna

    Hi Taruna
    You need to create two approval procedures
    1. SELECT distinct 'true' FROM OPOR T0 WHERE $[OPOR.doctotal] <= 50000.00
    2. SELECT distinct 'true' FROM OPOR T0 WHERE $[OPOR.doctotal]  > 50000.00
    So First Generate Two Approval States with the above conditions.(You Should attach the queries in approval Templates)
    Regards,
    Venkat.

  • 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

  • SO approval procedure query

    Hi Suda, I am trying to create a approval procedure for a query here is what I have so far:
    SELECT DISTINCT 'TRUE'
    FROM  [dbo].[OITW] T0  INNER  JOIN [dbo].[RDR1] T1  ON  T1.[ItemCode] = T0.[ItemCode] 
    WHERE T1.ITEMCODE = $[RDR1.ITEMCODE] AND T1.WHSCODE=T1.$[RDR1.WHSCODE] AND $[$38.14.NUMBER]<T0.AVGPRICE
    I basically want to check the price of the Unit Price field in the Sales Order against the avg price of an item  that is in the inventory if the Unit field price is less than the average price than the approval procedure should get triggered. I am not sure why the query is not working can you please help me with this. Thanks.

    The transaction notification is a hard block.  It will prevent the transaction from getting added and no drafts are saved.
    But we can give a message to the user asking him to save as draft.
    Search on this link https://websmp204.sap-ag.de/notes for term SBO_SP_TransactionNotification and you will find document explaining the usage of this.
    Please also search the term SBO_SP_TransactionNotification in this Forum.
    There are many threads that I have replied.
    Suda

  • Approval Procedure on Document Update

    I have a approval procedure that works great when a Sales Order is initially created.  The approval procedure does not trigger when an order is updated?
    Is that normal behavior?
    If so is there a way to have it check on update?
    Thanks

    Hi,
    I think it should be fixed ASAP. If this is the case then there is absolutely no point in having an approval process in place at all?
    If there is a purchase order approval created for PO's over 5000 for example, then all the user has to do is create an order for less than 5000 and then update it afterwards to what ever amount he/she likes, and it will go through without any approval?
    I really think that this should be given some urgent attention!
    Regards
    Grant

  • Help on Procedure and trigger for updating(urgent please)

    SQL> / Table A
    CTUT_ID CTUT_COMPANY_NAME CURRT_USER_ID FMIS_ID CREATE_DA UPDATE_BY UPDATE_DATE
    1234 A 15-APR-03
    2222 B 15-APR-03
    3333 C 15-APR-03
    4444 D 15-APR-03
    5555 E 15-APR-03
    6666 F 15-APR-03
    150282 G oRACLE 23-APR-03
    1 H 15-APR-03
    2 I 15-APR-03
    3 J 15-APR-03
    150343 K TIGER 24-APR-03
    150305 L EXAMPLE 23-APR-03
    150342 M SCOTT 24-APR-03
    sQL >/ Table B
    Empno     Empname UPDATE_BY UPDATE_DATE
    1 AA
    2 BB
    3 CC
    4 DD
    What i need to do is i need to create an update trigger on both tables
    like create a procedure
    1)In procedure i need to check like
    IF TABLEA.CURRT_USER_ID = (SELECT USER FROM DUAL)
    THEN
    UPDATE_BY = (CURRENT_USER_ID of CTUT_ID)
    FOR EXAMPLE CURRENT USER_ID IS SCOTT THEN
    UPDATE_BY = 150342
    UPDATE_DATE = SYSDATE
    ELSIF
    UPDATE_BY <=> (CURRENT_USER_ID of CTUT_ID)
    THEN
    MESSAGE('USER IS NOT IN TABLE);
    END IF;
    and call that procedure in the update triggers
    FOR BOTH TABLES TABLEA,TABLEB
    i CREATED A PROCEDURE BUT IT IS NOT WORKING
    ANY HELP PLEASE
    CREATE OR REPLACE PROCEDURE UPDATE(
    UPDATE_DATE out DATE,
    UPDATE_BY out VARCHAR2)
    IS
    Uuser varchar2(20);
    Udate date;
    Ufound number(1);
    BEGIN
    SELECT USER,SYSDATE
    INTO Uuser,Udate from dual;
    SELECT count(*),CTUT_ID into Ufound,Uctut_id
    FROM TABLEA
    WHERE CURRT_USER_ID = Uuser
    Group by Ctut_id;
    IF (UFOUND = 1) THEN
    UPDATE_DATE := UDATE;
    UPDATE_BY := UCTUT_ID;
    END IF;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    RAISE_APPLICATION_ERROR(-20001,'User Does not Exist');
    END UPD_CONSTITUENT;
    CREATE A TRIGGER :
    CREATE OR REPLACE TRIGGER TU
    BEFORE INSERT ON TABLEA
    FOR EACH ROW
    BEGIN      
    UPDATE(:NEW.update_date,
         :NEW.update_BY);
    END IF;      
    END;
    SQL> update TABLEA
    2 set CTUT_COMPANY_NAME = 'SCOTT TEST'
    3 WHERE FMIS_USER_ID = 'N';
    update TABLEA
    ERROR at line 1:
    ORA-04091: table TABLEA is mutating, trigger/function may not see it
    ORA-06512: at "UPDATE", line 12
    ORA-06512: at "TU", line 1
    ORA-04088: error during execution of trigger 'TU'

    Hi Mara,
    You are right thats what i want
    I have a table A
    EmpNo Empname Currtuser_id Update_date Updateby
    1 Denis Oracle
    2 Scott Scott
    3 Mara MMara
    1)what i need to do is when any user tries to update the table Table A
    Then the Trigger or procedure should check whether user is exits in table A in column currtuser_id
    If his user id exits in table A
    Then allow him to update the TABLE A
    and insert his EMPNO in UPDATE_BY
    and SYSDATE in UPDATE_BY
    He will do all this process using forms
    But i need to have trigger or procedure in database level for table
    2) I have another table like 10 tables
    Suppose TABLE B
    When user tries to update TABLE B
    Then the Trigger or procedure should check whether user is exits in table A in column currtuser_id
    If his user id exits in table A
    Then allow him to update the TABLE B
    and insert his EMPNO in UPDATE_BY
    and SYSDATE in UPDATE_BY
    3) I need to have a common Procedure and call that procedure in all tables in UPDATE TRIGGER
    Thanks for your help
    Thanks

  • Does editing document trigger Approval Procedures checking?

    Can anyone confirm that a document go through Approval Procedures checking when it is being added? It does not trigger the checking when it is edited?
    I notice if I add a document, the Approval Procedures kicks in, but if I edit a document (so that it meet the Approval Procedure criteria) the Approval Procedure does not appear.
    Thanks.

    Thanks Rahul, if the document initially does not trigger approval procedure but after changes it should trigger approval procedure, for example:
    Credit Limit $1,000, Outstanding Balance $800, user created a Sales Order of $150, added to the system and edit it to $250 after that. The editing should trigger approval procedure but it doesn't.
    Is it correct system behaviour?

  • 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

  • Update Sales Order after approval procedure

    Hi,
    Anybody knows is there any way that we can enable updating of non-numeric field e.g. "item details" in the Sales Order's row after it's posted? Note that there is approval procedure involved, and Sales order posted with a status (approved).
    I realized that only UDF at the document level can be updated. How to enable editing of UDF at the row level?
    Thanks!
    sianghing

    No. Other than Sales Employee field, there is no option to update row level data after approval.
    Thanks
    Gordon

  • Can DI Trigger approval procedures?

    Hi,
    I have added an approval procedure in B1, when a user adds an Order the manager approves it. Now when the same User adds the order using the DI, the apporvals fail. Is there any work around for this.??
    I have seen the previous posts regarding the same with no solution, is it solved now..?
    Thanks & Regards,
    Vasu Natari.

    This functionality is now available in 8.82
    From the What's New 8.82 Document:
    "The DI API now supports the entire approval procedure process.
    After you add a document that meets the condition of an approval template, the approval process is triggered and the document is saved as draft. The approver then looks up and updates the approval requests via the ApprovalRequestsService object in the DI API. When the approval request is approved, you can use the SaveDraftToDocument method in the Documents, StockTransfer and Payments object to convert the draft to a document.
      To activate the feature in the DI API, use the EnableApprovalProcedureInDI property in the AdminInfo object and make sure that the DocConfirmation property of the AdminInfo object is set to Yes."

  • Software Updating Procedure Should Be Changed

    Here is my offers:
    Instead of using the NSU at all, it would be better off if the SW download is prepared on the associted phone's support section with necessary change logs.
    Next thing will be: you just download the SW upgrade like you download a video file
    and then put the upgrade file in the phone: then the phone will recognize it and will start upgradin the phone automatically.
    I am tellin this from my expreience of using the PlaystationPortable.
    http://www.us.playstation.com/PSP/Downloads/SystemUpdate
    The NSU is a uncomfortable jerked off.
    Any comments, newer ideas, or amendments are welcome.

    12-Sep-200709:59 PM
    asgr86 wrote:
    Yes I totally agree with all of you. Even My phone crashed serveral time while software update but....
    1. Please do not compare phones with play stations.
    2. Technically its not possible to reinstall a firmware with a software running in it, its like removing your undergarments without removing your pants.
    3. if you cant/Scared to do an software update go to authorised service center and get it done.
    I think thats the best a phone can get updates else the update might just be called a patch which only fixes probems but dosent reinstall the firmware.......
    Strange,
    the PSP is shown for an example of how the SW download procedure should look like.
    No one here compares a psp with a phone.
    Reinstallin the FW is possible and many people do.
    For number 3, lots of people do it, and tired of it.Message Edited by korngear on 12-Sep-200710:10 PM

Maybe you are looking for

  • Report generation for users having specific license type

    Hi friends, For my project purpose i have to generate report which has userId,License type of the user,corresponding composite role and single roles assigned to the user and transaction code. I can get the report for user and license type from USR06

  • I can't update my macbook air 2012 to flash storage version 1.0

    hello, I'll install the update of my macbook air to version 1.0 but after the reboot the Mac app store shows me that I should update. I downloaded this version from this website but the the same result. Any suggestions? http://support.apple.com/kb/DL

  • Thinkpad W530 : How to install Windows 8 Profession​al over preinstall​ed Windows 8???

    Hi, please help me, I'm spending way too much time on an issue that should take me 1 hour max... When I try to clean install Windows 8 Professional from a dvd or a a usb key, my laptop silently retrieves the preinstalled Windows 8 key product instead

  • Publishing an ERD to a file fails without feedback

    I am using Designer 10.1.2.0.2 and am trying to publish an ERD to a jpeg file. I have tried turning on diagnostics but get no indication of errors, warnings, or failures in the log file. I can edit and save changes to the ERD but cannot get it to wri

  • Case Changes in C2D

    At the Apple Store the other day, I thought I noticed tactile differences between the C2D and CD models of the Macbook Pro. Can anyone confirm this? Has the case material changed? It could just have been the effect of thousands of grubby hands on the