Approval procedure vs Transaction Notification

Hello dear experts,
I have an issue with the approval procedures and the validations I have to do using the Transaction Notificacion Stored procedure.
this is the scenario and conditions to consider:
1.A purchase order (Doctotal) that are between 0 and 25,000 USD needs an approval.
2. A purchase order needs to have all the project column filled in before the approval procedure. this column is in the detail of a document, so all the rows have to be filled in with the right project code otherwise when your request have been submmited and your receive the approval you are not allowed to do any changes in the Detail Document.
I realized that the approval procedure is launched before the Transaction Notification SP.
So I decided to add a query for the approval procedure considering the validations in the project column:
SELECT distinct 'true'
WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99   ---This part works perfeclty!!!
AND LEN(isnull($[POR1.Project.0],''))>0 and $[POR1.U_SubJob.0]>0  )  --This part does not work
As you see in the query, I am trying to validate that all the rows have the project code (Project) and a UDF (U_SubJob) filled in.
Have anybody been done this before? How can I access to the detail values of the document? It is easy to acces values on the header.
I appreciate any help on this. Thank you very much

You must use both in approval procedure or use both in SBO store procedure transaction notification.
To request approval for a project, you this following approval query:
if (SELECT $[$38.31.0]) > ' '
select 'true'
the other query is for doctotal approval as follows:
if ($[opor.doctotalsys.number]) between 0 and 24999.99
SELECT 'true'
select distinct 'true' FROM OPOR
WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99
Both are able to use and work simultanously.

Similar Messages

  • Re: Approval procedure for automatic notification creation

    Hi All,
    I am trying to use Approval procedure in Supplier notifications. While creating a notification manually I am able to restrict the notification for further processing unless it is being approved. But when I am generating automatically through defect recording the notification is not getting the APRQ status.
    I have maintained the approval reqd. settings for both of the notification types ( Both Auto and Manual)
    Please advice.


  • Use Transaction Notification in Approval Procedures

    I want to use the "SBO_SP_TransactionNotification" Stored procedure in one of my approval procedures. I have implemented a approval procedure based on certain criteria when a "PURCHASE ORDER" is created. Now i want to send an email out to certain users when a approval is needed for a PO.
    I m not sure if transaction Notification is being used when Approval procedure are involved. For all POs that does not require an approval , my code for emailing uses in the SP is working fine.
    Has anybody came across this scenario? pls help.

    SBO_SP_TransactionNotification is not compatible with approval procedure.  This is clear mentioned in SAP Notes.  You may not use this SP in associated with approval.  I think there are alternative ways to achieve your goal.

  • I Don't know how to use SBO Transaction Notification  procedure

    Hi all
    I don't know how to use SBO Transaction Notification  procedure
    can any body give me description why we use,where we use,how we use some example
    Awaiting soon reply
    Rajkumar G.

    example is for testing, if on delivery is filled ref no of vendor or not
    if @object_type = '20'  and (@transaction_type= 'A' or @transaction_type= 'U')
         if 1 = (select count(docentry) from opdn with(nolock) where docentry [email protected]_of_cols_val_tab_del and (numatcard is null or len(numatcard) = 0) )
              select @error =1
              select @error_message = 'vendor ref no isnt filled'
    next example is for creating BP as vendor and testing, if dont begin for specific sign
    if @object_type = '2' and @transaction_type= 'A'
    if left(@list_of_cols_val_tab_del, 1) = N'x' or left(@list_of_cols_val_tab_del, 1) = N'X'
              if 1 = (select count(cardcode) from ocrd where cardcode = @list_of_cols_val_tab_del and cardtype in ('S', N'S') )
         select @error =1
              select @error_message = 'Vendor code cannot begin to X sign.'
    is it clear?

  • Approval procedure for Outgoing payment

    Dear all expert,
    I want to know how to make approval procedures for outgoing payment. So, everytime user create outgoing payment, it can't be printed until it's approved by Chief Acct. Where do i set this approval, because i see in the approval module, there is no  outgoing payment document.

    I have checked that, at least until 2007A version PL49 Outgoing payment has not yet added to Approval Template.  You may use SP Transaction Notification to block some users for posting.

  • SO approval procedure query

    Hi Suda, I am trying to create a approval procedure for a query here is what I have so far:
    FROM  [dbo].[OITW] T0  INNER  JOIN [dbo].[RDR1] T1  ON  T1.[ItemCode] = T0.[ItemCode] 
    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 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.

  • In approval procedure user do not want to refresh the software

    Hi all,
    In approval procedure i prepare the approval for outgoing payment, so when the user pass the transaction the approval going to manager but my issue is the manager must refresh his user when any new approval is coming.
    i don't want to refresh again & again so you have any solutions of these tell me.

    This is a database function that you have to refresh to get new data displayed.  If you do not like it, I am afraid something must be developed by SDK tool to auto refresh for users.  It may not be achievable though.  Post it on SDK forum to involve experts there.

  • 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.
    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
          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
                  INSERT @TempTable VALUES ('TRUE')
         END ELSE INSERT @TempTable VALUES ('FALSE')
    @Counter = @Counter + 1
    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.

  • SBO_Post Transaction Notification

    SBO_Post Transaction Notification
    Hi Experts!,
    I´d like to get information about this Stored Procedure, can somebody give me any link, papers, etc?

    Hi Ronald ,
    Files are located in SBO_Knowledge_village group and below i paste is the link ,
    Jimmy Michael (See top contributors Gordon,Suda,..Jimmy) is the moderator of the form .Ask him to join you in this group . You can acess more documentation .
    Thank you

  • Transaction Notification with DI Server

    I am developing a Web Site with the DI Server, when I have validations in the Transaction Procedure the error  message is incorrect.
    Message: Could not commit transaction.
    Transaction Notification
    set @error='10'
    set @error_message = 'SP: 123'
    -- Select the return values
    select @error, @error_message
    I made the test with the DI - API  and the message is correct.
    Exists a workaround for this problem???
    Edited by: Andres Naranjo on Sep 1, 2010 1:25 AM

    This problem was solved in SAP Business One 8.8 PL20.

  • Transaction Notification - Journal Entry

    Dear Experts,
    Can anyone tell me how to validate Journal Entry line wise using Transaction Notification Stored Procedures. I want to validate each and every row of the Journal Entry.
    Thanks in advance

    Please close this duplicated thread. Check this announcement:
    Thanks & Regards,

  • Transaction Notification with Addon

    Hi guys,
    I want to be able to get a transaction notification whenever a sales order is added in SAP B1. I want to retrieve the document entry of the sales order in an Addon that uses only the DI API. I have a lot of experience in building addons, but have no experience with transaction notification. How can this be done?

    Hi Costas
    Is your customer a new one? I mean:
    Pricing is only applicable to new customers with a contract date after July 15th 2013.
    Take into account that in case you only want to be able to get new SO from B1 system you would probably need to buy only one license which suggested price is 750 EUR. I know it is certainly not nothing but still it is not that much.
    As for your question regarding TN I'd do it like this:
    use PostTransactionNotice procedure to grab a DocEntry of new SO and insert it into your own log table; you can also write a trigger on ORDR table to achieve it
    create CLR procedure to do something with logged DocEntry from your table using DotNet; you probably want to be able to pass a parameter to this procedure and get some output after its execution
    use a SQL job to grab only new records from your log table and execute a CLR against each one; update status in your log table; write down error, error message and so on...
    If have never done any CLR before check this link to learn how easily it can be done to use regex within SQL Server:
    Kind regards,

  • Transaction Notification to Prevent Duplicate Barcodes

    I please need a transaction notification to prevent users from using the same bar code on more than one item i.e. barcode xyz may only appear once in the codebars field in oitm.

    I assume you want to allow the empty bar code field.
    Then  nsert this in your  SBO_SP_TransactionNotification stored procedure after the line
    --     ADD     YOUR     CODE     HERE
    If @object_type = '4' and @transaction_type in ( 'A','U')
    declare @B nvarchar(16)
    set @B=(Select isnull(I.CodeBars,'') From OITM I
        Where [email protected]_of_cols_val_tab_del)
    If @B!='' and exists
    (Select I.CodeBars From OITM I
        Where [email protected] and [email protected]_of_cols_val_tab_del)
    Select @error =12, @error_message = 'Duplicate bar code !!'

  • Help Restriction Purchase Order Transaction Notification

    Good afternoon experts community'm doing a lock which I doubt as raise it, the case is as follows:
    The purchase order should not be created if the unit price of the item is higher than the price of the price list of sap, the problem is that now they will start to use the extra coin price list, that is why it is requires blocking the creation of the purchase order if the order price is higher or not applicable to the two alternatives we have in our price list.
    In advance I will be grateful if anyone reads this post and I can reach out to fill this requirement and also bring something more to my knowledge.
    best regards!
    if @transaction_type = 'A' and @object_type='22'
        set @itemcode =(select top(1) o1.itemcode
                          from opor o inner join por1 o1 on o1.docEntry = o.docEntry
                                      inner join ocrd c  on c.cardcode  = o.cardcode
                         where u_facnum is not null
                           and  not exists(
                                           select *
                                             from itm1
                                            where itemcode  = o1.itemcode
                                              and pricelist = c.listnum
                                              and (price > o1.Price and AddPrice1 > o1.Price  or itemcode in ('FLETE','SEGURO'))
                           and  o.docEntry = @DocEntry)
       if (
           select count(*)
             from opor o inner join por1 o1 on o1.docEntry = o.docEntry
                         inner join ocrd c  on c.cardcode  = o.cardcode
            where u_facnum is not null
              and  not exists(
                              select *
                                from itm1
                               where itemcode  = o1.itemcode
                                 and pricelist = c.listnum
                                 and (price > o1.Price and AddPrice1 > o1.Price  or itemcode in ('FLETE','SEGURO'))
              and  o.docEntry = @DocEntry
         set @error = 1
         set @error_message = 'Error el articulo '[email protected]+' no concuerda a lista de precios del cliente.!'     

    Please avoid using Transaction Notification if you want to insert a B1 object via DI API using the integration framework.
    The reason is, that the integration framework uses the DI API logic and this transaction notification runs on top after the DI API process is finished. Therefor it is not really part of the DI API process.
    This could cause an unexpected exception in the DI Adapter of the Integration Framework.
    My proposal is to check your mentioned logic within the integration framework instead of using the transaction notification at the end.
    E.g. Build a flow using a SQL Call atom to retrieve the pricelist price you want to compare with.
    You can built a conditional processing in your integration flow to avoid the creation of the purchase order or directly change the price on the flow.
    Another option is to check your logic, create the purchase order with status "for approval" and inform the keyusers via B1 alert message out of your integration scenario step.
    Best regards

  • Approval Procedure for Items

    Hello  experts,
    During my operation some users creates Items in, u201CItem Master Datau201D, but they make mistakes, so I want to approve if they are doing that right.  But there is no option for that in u201CApproval Procedureu201D any idea how can I Approve the creation of an Item, or something like that.
    As Example:     
    Choose an u201CItem Groupu201D
    Leave blank the check box in u201CWithholding Tax Liableu201D, etc

    HI Carlos,
    Approvals are for documents in Business One.
    You can use Alert or Transaction Notification. Alert will only tell you after the entry is done while Transaction Notification can actually block the entry.
    Hope it helps,

Maybe you are looking for