Approval procedure error

Dear all
I tested this query in approval template for the user "X" in Purchase order,while adding the  PO its showing error
called "Failed to commit  transaction [131 - 209]" for the X user
Select Distinct 'True'  from OPOR To Where  $[OPOR.NumAtcard] = 'DRM'

Select Distinct 'True' from OPOR T0 Where T0.NumAtcard = 'DRM'

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.

  • 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

  • Store procedure to be triggered before approval procedure.

    Dear Experts,
    This is with reference to Approval Procedure and store procedure. I have created the store procedure which validates the series with user defined field value.
    If there is difference in the field value of series & user defined field, system will block the entry ( this is defined in store procedure) & also approval procedure is also defined for the same document (i.e. Document value greater than 1 Lakh).
    Now the problem, on creation of documents system trigger the Approval procedure and the document is sent for approval; but the store procedure defined is not reflected before approval & after the approval user cannot change series.
    Is there any way the store procedure can validate the value before approval procedure is triggered?
    Thanks & Regards,
    Yogesh Jadav.

    Hi Raj,
    Below are the queries for Purchase Order & Purchase Order Draft.
    Purchase Order Draft----
    if @object_type='22' and (@transaction_type='A' or @transaction_type='U')
    begin
    if exists(select T0.docentry from odrf T0 inner join NNM1 T1 on T0.series=T1.series where (T1.seriesname like 'Ord%') and (T0.U_Stage<>'Order') and t0.objtype='22' and T0.docentry=@list_of_cols_val_tab_del)
    begin
    select @error=1, @error_message='Series name and category should be both order'
    end
    end
    Purchase Order----
    if @object_type='22' and (@transaction_type='A' or @transaction_type='U')
    begin
    if exists(select T0.docentry from opor T0 inner join NNM1 T1 on T0.series=T1.series where (T1.seriesname like 'Ord%') and (T0.U_Stage<>'Order') and T0.docentry=@list_of_cols_val_tab_del)
    begin
    select @error=1, @error_message='Series name and category should be both order'
    end
    end
    Yogesh Jadav

  • 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

  • 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

  • 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

  • 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 Templates Error Message

    Hello Expert,
    I am a new user of SAP B1:
    I need a user to be able to create A/P Invoice Draft instead of posting the A/P Invoice to G\L...
    When I go to Administration>Approval Procedures>Approval Templates, I have a list of users who usually create A/P Invoice Draft for Approval..., I notice that the user who have to create draft is not listed.
    When I insert the user in the list, sap return this error message after clicking on 'Update Button' :
    *Fixed terms cannot be selected when the 'use terms flag' is false Message 3621-12*
    How can I resolve this issue?...
    Thank you...
    Ben

    Hi Ben,
    Please check the following Notes if they help in your case/senario :
    [Note No. 1024874|https://websmp130.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1024874]
    AND
    [Note No. : 1144345|https://websmp130.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1144345]
    Check if it helps.
    Regards,
    Jitin
    SAP Business One Forum Team

  • Sales order not editable after approval procedure

    Dear SAP,
    for a customer we need to find out a way to edit sales orders after approval. Example: User fills a sales order with more than 100 positions and had a typing error which is realized later.
    Next example: Customer wants the delivery conditions to be changed. We know that changing a document after approval might sound strange - but the customer's processes are like that.
    Thanks a lot in advance, sincerely
    Guido

    It is not strange that every now and then, users have requests to change a document after approval.  However, the discipline is absolutely necessary here.  There is no room for you to change.  Otherwise, the approval procedure may not be that useful.  If there is typo, you have to recreate the document.  Next time the problem would be less. If unfortunately customer wants the delivery conditions to be changed, then you have to recreate the document too.
    Thanks,
    Gordon

  • How to remove approval templates in approval procedures

    Dear sir,
    How to remove approval templates in approval procedures. I have remove some approval templates but some one are not removed. that time i got one error that is "Cannot remove. There are existing authorization processes based on the current template.   [Message 3621-8]" , If it is not removed any solution is there to remove that approval template
    Plz tell me how to solve this problem with step by step procedure in sap business one 2007B.

    Dear sir,
    how to remove approval templates in approval prcedures.
    In this first i will give approval stage to one user, now i have to remove that user from the approval stage. but in my approval templates ( in that stages column) i have give to that approval stage user. now i remove that approval stage user. i have untik the active check also . when i remove that approval  template this error will come in to picture. "Cannot remove. There are existing authorization processes based on the current template.   [Message 3621-8]"
    now tel me the step by step procedure. bcoz iam sap b1 trainee

  • Customised Approval Procedures

    Hi,
    I am trying to create an approval procedure such that on entry of an SO by Logistics or Sales, the approval should go to the respective manager to whom the customer account belongs to.
    The query is:
    SELECT 'TRUE' FROM OCRD T0 where T0.OCRD.U_AT_PC = 'Central'
    on trying to create an approval Template using the above query, the error i get is "No ratio defined"
    Please comment on why this error is generated.
    Also Will the above query work?
    Regards.

    Hi Vishal
    If I understand you correctly, you have an approval template & stage for each customer account manager. The problem seems to be your query. You cannot refer to the Table using T0.U_..... You have to use the $ square bracket format to refer to the runtime value. Your query is looking for a value from the table which will not contain the SO you are currently processing as the Approval checks before the ADD is committed to the DB.
    Try the following query rather:
    SELECT 'TRUE' WHERE ${OCRD.U_AT_PC} = 'Central' .
    Please Note : Square brackets are replaced by an underline in this forum, so I have used the squiggle brackets instead of the square brackets.
    Kind regards
    Peter Juby

  • Approval Procedures and Stored Procedures

    Hi All
    I have a problem with approval procedures and stored procedures.
    I created an approval procedure to check if a value in the udf is selected or not . if not then a messge is produced to ask the user to select the person to approve the PO.
    Biut now the problem is the PO's are linked approval templates to the error messge don't show before the approval template screen.
    Please assist.
    Thanks
    Bongani Dlamini

    Hi Gordon
    The stored procedure is just for validating if the user has selected the udf value.
    It is not for approval*
    I created an approval template for this purpose. So my problem is when I add the Po to the system the SP doesn't kick-in and alert the user to select the person to approve the PO.
    Process Flow.
    User captures PO then select the value on the UDF Field ( Approver) The value selected is linked to a query which is used by the Approval Template
    If this method is still not supported then please let me know .
    Thanks
    Bongani Dlamini

  • 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

Maybe you are looking for

  • How to change an apple ID for iCloud only.

    Hi, I am trying to set up my kids iPods before Christmas morning.  I want their iPhones to have their own apple ID's for iCloud so we don't sync contacts, etc.  I want us to still share an ID for iTunes, which is set up.  Here is the question: Do I j

  • Html email hotspots problem

    Hello, I created a simple HTML page with graphics and links that I sending as and email. I've posted my page and I use the "Send page as email" to send it as a newsletter. It send fine and I see everything and click on all the link that I need to. I'

  • How can I get the kindle ebooks on my iPad Mini to backup or transfer to my macbook air?

    I have both iBooks and the Kiindle app on my iPd Mini.  How can I get the Kindle ebooks to backup or transfer to my MacBook Air?

  • Attach Query Report to Purchase Report.

    Hello Xperts.... I have executed a query report regarding  purchase orders. Now I want to attach that query report in my purchase Reports(Modules -> Purchase A/P -> Purchase Reports) but not in My Menu. Plz reply...Thanx..

  • Draw line in Webdynpro Views

    Hi, If I want a horizontal line to display on the output screen. What UI element do I have to use to create a line? If I use Matrix layout can I create borders for each cell? Thank you, Renu