Query support for approval templates

hi
i want set approval on the base of query so i write query as follow 
SELECT T0.[CardName], T0.[CreditLine] FROM OCRD T0  INNER JOIN OCRG T1 ON T0.GroupCode = T1.GroupCode INNER JOIN OINV T2 ON T0.CardCode = T2.CardCode
WHERE T1.[GroupName] ='INSTATION' AND
T0.[CreditLine] >= 0 AND
T0.[CreditLine] <=50000
GROUP BY T0.[CardName],T0.[CreditLine]
but on this condition approval is not set so if i write query wrong then pls send updated quer
regards,
sandip

Hi
There are plenty of threads how to write user defined query for  writing approval query .
You have to use something like this ;
Select Distinct true ...
Here is what I found for you
Re: HELP TO WRITE A QUERY
Please search forum first
Thank you
Bishal
Edited by: BIshal Adhikari on Dec 11, 2008 9:59 AM

Similar Messages

  • Adding a query to the approval template

    Hello
    I'm trying to setup an approval template for AR Invoices based on a UDF.
    Basically I want to add a query to the approval template that will trigger an approval request based on the following query
    but i don't know how to set it properly.
    trigger an approval when:
    select * from OINV where u_ordertype = 'sub'
    any help would be appreciated it!
    Mike

    Hi Mike,
    Try this:
    select 'true' from OINV T0 where T0.u_ordertype = 'sub' and T0.DocNum = $[$8.0.0\]
    Thanks,
    Gordon

  • Multiple query support for BICS

    Hi,
    Here are few queries:
    1 - Does new BICS connection support multiple BW queries for a dashboard? Any limitations with BICS?
    2 - How does Xcelsius handle huge data coming from BW in queries?
    3 - is EHP4 on ERP side a mandatory thing for upgrade to SAP NW BW Ehp1?
    appreciate answers.

    Hi Ingo,
    Thanks a lot for the clear answer.
    Well a couple of more questions are still unanswered:
    1 - "Is EHP4 a mandate for having Ehp1 on SAP NW BW? If we just install Ehp1 on BW side without upgrading the ERP, will there be any issues? We want the EHP1 only for leveraging the BW-BO integration features and are not looking at any additional functionality from the source system. However we would like to know if upgrading BW with EHP1 WITHOUT upgrading the current ECC to EHP4 has any adverse effect (known-documented) on the current BI/ECC systems?
    2 - Do we have Universes supporting multiple queries in coming releases? If yes then from which release onwards?
    Due to these a major decision is sitting on fence and we are not able to make any headway.
    Need a clear answer for this as well.

  • Dreamweaver support for Sharepoint templates

    I'm trying to edit an existing Sharepoint (bootstrap) template in Dreamweaver.
    while editing the sharepoint template I don't get to see the result in the website, because Dreamweaver seems to make a .temp file of the original template, which doesn't show in the website. I already turned off the option preview temp file in browser. But this doesn't resolve my problem.
    When opening the original page in Dreamwaever, the programm seems to generate additional white-spaces all over the page. Is there a possibilty to get rid of this whitespacing?
    This also seems to disturb the page to be shown in the browser

    Maybe this will help http://blogs.technet.com/b/speschka/archive/2012/07/27/using-dreamweaver-and-design-manage r-with-sharepoint-2013.aspx

  • I cannot find any support for using templates to send to multiple addressees

    I used this system last year, but cannot find how I did it; I want to send to all people in the special address book that I have set up, but without revealing the email address of all the members to each individual. I am using Thunderbird 24.6.0

    Create a mailing list and use BCC.
    http://kb.mozillazine.org/Thunderbird_:_FAQs_:_Create_Mailing_List

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

  • Is it too much to ask MS for a simple ad-hoc query tool for end users?

    Hello
    This is a general MS BI topic and not specific to Power Query, but I couldn't find a more suitable general forum for it.
    This posting is the result of the frustration I have with MS BI stack, whereby a simple ad-hoc drag and drop query tool to get the data in a table format (preferably from a relational
    data source) is missing, something that other big vendors have, such as SAP Business Objects Universe and the associated tools. The deprecated SSRS Report model and SMDL was the closest MS ever got to this functionality (although that had some limitations
    too), which unfortunately is dead now in favour of all sort of "Power" tools that basically can’t deliver the same functionality.
    The requirement is pretty simple: provide users with a tool that they can drag and drop fields from different entities in a data model without having to worry about entity relationships and
    apply necessary filters and get the data out in Excel or CSV, no fancy (or even simple) aggregation or formatting is required, and users should only see the rows they are authorized to see, i.e. row level security (RLS) of data.
    Let’s see what we have at our disposal from MS BI:
    From the modeling perspective, we have relational models in the database that support RLS with views, but obviously cannot maintain PK-FK relationships in the database model between views. Other
    models are .Net Entity Data model Framework model exposed as OData, and SSAS tabular, SSAS PowerPivot, SSAS multidimensional, which you can find a good comparison of their features here:
    http://www.sqlchick.com/entries/2012/3/4/decisions-powerpivot-ssas-tabular -or-ssas-multidimensional-m.html
    From the tools perspective we have:
    Power Query on top of a relational database (SQL Server): Can connect to relational databases easily, generated queries are optimal, detects relationships with entities, but only when entities
    are tables and have PK-FK relationships enforced in the database. So can’t detect relationships with views and hence can’t enforce RLS, so this is not an option unless users keep joining entities, which is not a desirable option either.
    Power Query on top of an OData: Works well except that queries generated for multiple entity expansion are terrible (look here for more details:
    http://social.technet.microsoft.com/Forums/en-US/7a8b8e52-d3a9-42af-bc52-9d5459c00529/odata-multilevel-expand-query-issue?forum=powerquery). In addition all filtering and projections are done at client side, so even if you want 1 row out of 1 million, all
    rows are brought over to Excel before filtered. Overall this results in unacceptable performance even for small sized data.
    Power Query on top of a tabular model: Doesn’t support that type of data source yet (http://social.technet.microsoft.com/Forums/en-US/ebcccb5e-7058-4046-917d-3d7fcf60cbdc/tabular-model-as-data-source-for-power-query?forum=powerquery).
    Even if it did, tabular models don’t support Many-to-Many relationships out of the box and not sure if there are plans to support tabular models in Direct Query mode in Power Query to take care of RLS.
    Excel on top of tabular models or multidimensional models: The tabular model should not be in Direct Query mode and you only get to use PivotTable to query the model. PivotTables are not famous
    for generating optimal MDX queries, so performance is not going to be acceptable if you are dealing with large dimensions, especially large junk and degenerate dimensions. You can use drilltrough to get details of a measure, but you have to specify the columns
    for a drilltrough action upfront, no flexibility for users to select what they want to see.
    PowerPivot on top of relational databases: The query designer cannot detect relationships between views, so users have to perform manual joins, not an option.
    PowerPivot on top of a multidimensional or tabular model: The query designer doesn’t generate optimal MDX queries by drag and drop. Especially there doesn’t seem to be a way to add related
    attributes of a dimension attribute to the query without cross joins which results in poor performance on large dimensions. Other issues found here
    http://sqlblog.com/blogs/marco_russo/archive/2010/08/24/using-ssas-2005-2008-as-powerpivot-data-source-query-designer.aspx. In addition the result set has ugly column names and issues with data types, such as interpreting numeric data types as Text, and
    there’s no straight forward way of getting the data from PowerPivot directly to Excel. The user either has to do a copy/paste (which doesn’t work on large datasets) or create a pivot table, bring the measure, and drillthrough the measure to get the details
    in table format.
    PowerPivot with OData: Treats every entity as a separate table to import, not suitable for our use case.
    Report Builder and SSRS on top of relational, multidimensional or tabular model: Given the query designer is the same as PowerPivot, it has similar issues. In addition, there are 4 more steps
    from designing a query to generating an Excel or CSV output, not an option.
    PowerView: Works against tabular and multidimensional models, but there’s no way of exporting data to Excel sheet. Besides the add-in is not available for Excel 2010.
    Good old MS-Access: Link to tables and views through ODBC, create relationships between entities and give each user a copy of that Access database to create their queries, and deal with the
    nightmares of updates to the model and distribution of new models to the users! Did I mention Access as an option?
    So there you go, 10 options, none of which can deal with a seemingly simple use case sufficiently. At the moment, the best among them appears to be option 6 against a heavily optimized OLAP
    cube, and perhaps #3 when/if Power Query support for tabular models in direct query mode arrives. Perhaps I am missing something very obvious, and would like someone to enlighten me here.
    Thanks
    MR

    Hi, as far as I can infer, that term means it's not loading any resources until needed, opposite of this...
    -bind_at_load
                     Sets a bit in the mach header of the resulting binary which tells dyld to bind all symbols                when the binary is loaded, rather than lazily.
    https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man1/ld.1.html
    Load resources lazily.
    You should never load a resource file until it is actually needed. Prefetching resource files may seem like a way to save time, but this practice actually slows down your app right away. In addition, if you end up not using the resource, loading it wastes memory for no good purpose.
    http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneos programmingguide/PerformanceTuning/PerformanceTuning.html
    And, higher OS versionsare even worse with Bonjour/mDNSResponder, but might see this...
    http://support.apple.com/kb/ht3789

  • Approval Template Query

    Hi, Is it possible to setup a approval template where an approval is required for all AP invoices that include a GL account that has a budget set for it?
    Thanks,
    Jane

    Hi,
    Yes possible to set approval template by means of query which is to be assigned under "Terms tab". But following condition should be meet,
    1. Under general settings--->BP tab, you have to select "Warning" check box.
    Thanks & Regards,
    Nagarajan

  • Approval Template based on Query

    Hi All,
    I want to wirte a query for defining approval templates.If any document (both on sales and Purchase side) is raised by a non-superuser,it should be sent for approval ,to the superusers ,before it is posted.
    we have set approval templates for this.
    But now,if the document contains the items with group code '101' ,then it should be sent for approvel to the superuser 'A' alone.(it is sure that in a single document items with different group codes will not be present).Others should be sent for approvel to superuser 'B'.
    I know that this can be done only by using "Terms based on Queries" in approval templates.
    I have never used this before.Can anyone help me with the query for this template?
    Thanks& Regards,
    V.M.Nivasini

    Hi
    The query is like this
    SELECT T2.[ItmsGrpCod],T1.[ItemCode] , T1.[Dscription] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T2.[ItmsGrpCod] = 101
    Create different queries for different Groups in where clause, Assign the query to respective Approver.
    Hope this helps.
    Regards
    Reno

  • Approval Templates On Query Base Not working..

    hi.
    Plz have a look on uploaded image.
    here i had highlighted that no of approvals are required at approval stages form
    what is the meaning of 2 ,
    ->i think the  2 people approval we need compulsorily.  Am i currect.
    ->In approval Stages i added two persons but i given no of approval need 1
    what will happen . If any body one person will approve , will it approve the document am i currect.
    And one more thing In Approval template under terms i am using query based on this one
    the document should be approve if i give Doctotal total Greater than amount  working fine
    but i need query base approve..
    what i need while adding the sales quotation if project code is not empty
    it will take the approval
    select  t0.docentry from oqut t0 inner join qut1 t1 on t0.docentry=t1.docentry where t1.Project <>''
    the above scenarios i will check it..
    but i need your valuable suggestions...

    Thank u working fine..
    last Question plz reply to me.
    1)Is Approval Stages are unique means
    in approval template if i use one approval stage in another approval template can i use same approval stage  will it work...
    2) in approval stage
    Total authorization persons are 2
    The below scenarios i am able to add the document i can able to update it.
    no of approval 1
    no of reject 1
    what is the meaning
    if out of 2 persons if any body approve the document document will add
    if out of 2 if any one person reject then  the document will reject
    no of approval 2
    no of reject 2
    Two users should approve the document otherwise document should not be add
    Two users should reject the    document otherwise document should not be reject
    no of approval 2
    no of reject 1
    two users should approve the document otherwise document should not be add
    out of 2, one user should reject the document no need second users reject
    no of approval 1
    no of reject 2
    one user is enough
    two users need to approve the document
    Plz clarify my doubt.
    I am waiting for your reply..

  • Approval Templates: Inventory Transfer - based on Query (help)

    This is a newbie question but I don't have time to read or dig thru forum sorry.
    We have an Approval Template setup to alert/approve Inventory Transfers but it is set to Always on the Terms tab.
    We would like to modify it for only transfers into a certain set of warehouses).  How do i create a query that will determine the Warehouse Code (if warehouse code is:'WHL','ITL','RTL','WEB','CTO-WHL','CTO-ITL') on transfer and send the alert/approval notification.
    I know this has been done 1000 times over but please enlighten me.
    SELECT whsecode FROM wtr1 in ('WHL','ITL','RTL','WEB','CTO-WHL','CTO-ITL')

    Hi David......
    There are few Threads discussed on Forum that Approval Procedure for Row level is not possible. Ther may be some work around in doing this.
    You may search this post in forum as it is readily available........
    Approval procedure
    Regards,
    Rahul

  • Approval Template based on overdue invoices for a Region

    Hi,
    We have set an approval template for all overdue invoices which should go to the repsective sales managers for approval.
    We have setup two approval templates one for Central region and one for NES region.
    The template involves running of the following query and going to the respective manager for approval, however this does not work.
    When we create a seperate location wise approval template it works:
    Please check and let me know the error if any:
    SELECT DISTINCT 'TRUE'  FROM OINV T0 and OCRD T1 WHERE T1.CardCode =
    $[$4.0.0] and T1.U_AT_PC = 'NES' and T0.DocDueDate <= Getdate()  AND  T0.DocStatus !='C' AND $[ORDR.CARDCODE] = T0.CARDCODE
    Regards,

    Hi Gordon,
    Thanks for your reply!
    Actually, we had created the following query as per our requirement for all overdue invoices:
    SELECT DISTINCT 'TRUE'  FROM OINV T0 WHERE T0.DocDueDate <= Getdate()  AND  T0.DocStatus !='C' AND $[ORDR.CARDCODE] = T0.CARDCODE
    ( here the customer name in the order should be equal to the Invoice Table Customer code )
    and the location wise query:
    SELECT 'TRUE' FROM OCRD T0 where T0.CardCode =
    $[$4.0.0] and T0.U_AT_PC = 'NES'
    When i tried using this query with the Overdue invoice query the same order had to be approved by the manager twice, which is not acceptable.
    The problem in using the location wise approval template with the query, was that the "Confirm Credit Line Deviation" prompts up every time we try to enter a Sales Order.
    Whereas we wanted an alert to be prompted to the sales manager once any sales order is entered however if the SO is above the credit limit the sales manager should know about it, which can be achieved if we use the overdue invoice query correctly.
    I tried clubbing both the above queries together,but it doesn't work.
    Is there a way where you could use one query with an IF clause saying that if the UDF field is U_AT_PC= "NES" then go to NES sales manager if U_AT_PC="Central" then go to Central sales manager.
    Please revert
    Regards

  • Support for export keyword for templates in sunCC ?

    Hello
    Currently sunCC says
    "OutputTemplate.hh", line 16: Warning: Export ignored -- not yet implemented.if I try to use export to export my templates.
    Is sunCC going to support export keyword, like Comeau and Intel compilers ?
    When will export be implemented ?
    Thank you,
    Timothy Madden

    Then why the warning message 'not yet implemented' ? It so makes me think that in the next update there I will find it !
    And it so makes my appetite for it grow ! :)
    I am very sad to hear such a point of view especially as an official attitude.
    I mean this reason, that there is only one implementation and the other compiler implementers did not implement it, so Sun will also not implement it, is quite ... hard to expect.
    After all, all new C++ features were also not implemented by compiler implementers when they appeared, until they implemented them ...
    I do not think many programmers so confuse export ed templates with extern declarations. Most programmers actually know what templates are and how they are instantiated on demand. Beside, the fact that the template definition needs not be seen by the compiler at the point of instantiation is quite true, as this is the point of using export :). The definition will just be found in one of the object files, at some point before linking.
    What the "definitions-separate" default compilation model does is effectively including the template definition in every .cc file, just like I would have included it in .hh file in the first place. This is what export is to prevent: it does not include nor need the template definition until some point before linking, at which all translation units have been translated (compiled) and the template definition can be found.
    It is true that in a way template instantiations use symbols from both the definition point, and the instantiation point, but this is intentional and the programmers should all well know about it. The C++ language also has quite some others such hidden effects after all ...
    Merging the contexts, or instantiating the templates, should actually have nothing to do with the actual linker or the link-time, if export is to be implemented for real.
    Rather the instantiation should be a separate step in the build process, after compiling and before linking, effected by a compiler-provided tool created specifically for compiling template definitions (from object files) into instances; or such a tool could be the compiler put in some special post-compile instantiaton mode. The tool would indeed be given all the object files in a program, and would resolve references between them for instantiation requests, as a linker does, so it might look like it is linking; however it only does template instantiation and it includes actual compiler functionality for that, so it is closely related to the compiler.
    So instead of a compile-and-link build model application developers would have a compile-instantiate-and-link build model.
    I just hope for more people to see how export is, and not rejecting it ...
    Thank you,
    Timothy Madden
    Edited by: Madden on Jan 21, 2010 7:31 PM

  • Query for approval

    I have updated SBO_SP_TransactionNotification for validating sales order.The query is as follows -
    if @object_type = '17' and @transaction_type IN ('A')
    begin
            declare curItem  cursor  for Select PriceBefDi,ItemCode,SeriesName FROM
         RDR1 INNER JOIN ORDR ON RDR1.DocEntry=ORDR.DocEntry
            INNER JOIN OUSR ON OUSR.UserId=ORDR.UserSign
         INNER JOIN NNM1 ON NNM1.Series=ORDR.Series
         WHERE ORDR.DocEntry=@list_of_cols_val_tab_del AND USER_Code<>'manager'
         declare @dblPrice numeric(10,2),@dblItemPrice numeric(10,2)
           declare @strItemCode varchar(20),@strSeriesName as varchar(40)
         open curItem
            fetch next from curItem into @dblPrice,@strItemCode,@strSeriesName
           while @@fetch_status = 0
         begin                         
              SET @dblItemPrice=(select price from itm1 where itemcode=@strItemCode and pricelist=(select listnum from opln where listname='Sales price list' ))
              if @dblItemPrice>0 and charindex('DEM',@strSeriesName)=0
              begin               
                   if @dblPrice<@dblItemPrice AND charindex('REP',@strSeriesName)=0
                   begin
                        set @error =1
                        set @error_message = 'The price of the item ' + @strItemCode + ' should be equivalent to sales price list i.e.' + cast(@dblItemPrice as varchar)
                   end
                   else
                   begin
                        if @dblPrice>@dblItemPrice
                        begin
                             set @error =1
                             set @error_message = 'The price of the replacement item ' + @strItemCode + ' should not be greater than sales price list i.e.' + cast(@dblItemPrice as varchar)
                        end
                   end
              end
              fetch next from curItem into @dblPrice,@strItemCode,@strSeriesName
         end
         close curItem
         deallocate curItem
    end
    This stored procedure is working correctly as per the requirement.Sales order can not be added if the price is less than sales price list.
    Now I want to remove this validation and add approval for this.If the rule is violated ,then the document will go for approval.In SAP I have created query for approval as,
    SELECT DISTINCT 'True'  FROM OITM  WHERE ITEMCODE=$[$38.1]  AND U_Discount_Percent < $[$38.15]
    UNION
    SELECT (CASE WHEN $[$38.14]<>(select price from itm1 where itemcode=$[$38.1] and pricelist=(select listnum from opln where listname='Sales price list' ))
    THEN 'True' ELSE 'False'            END)
    Here I am getting the price as varchar.Is it possible to call stored procedure SBO_SP_TransactionNotification from query ?

    Hi Dilip,
    I have tried the following query for approval :
    SELECT 'TRUE'
    FROM OITM JOIN ITM1 ON OITM.ItemCode=ITM1.ItemCode
    JOIN OPLN ON OPLN.ListNum=ITM1.PriceList AND UPPER(LTRIM(RTRIM(OPLN.ListName)))='SALES PRICE LIST'
    WHERE OITM.ItemCode =$[$38.1.0] AND $[$38.14.NUMBER] != ITM1.Price
    It works for all the lines in Sales Order.Even If there is a single item with Price before Discount not equal to Sales Price List Value,
    System will send the document for approval.
    I have put the condition $[$38.14.NUMBER] ! = ITM1.Price assuming that the price in SO should be exactly equal to Sales Price Price  List .
    Try this query at your end and let me know the result.
    Thanks and Regards,
    Pooja Singh.

  • 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

Maybe you are looking for