Approval using User Queries

Hello everyone.
I need approval using User Queries on  Detail Sales Order  when User Field "U_DifSec" value change '02' (default value) to '01' at least one row.
This is the Query, but don't  function on SAP if running on SQL Managment studio do function very good.
Declare @conteodescuento int,
        @docentry int
Set @docentry=(select DocEntry FROM ORDR Where DocNum = $[$8.1.0])
Set @conteodescuento = (select count (*) from RDR1 Where docentry=@docentry and U_DifDesc='01' group by U_DifDesc, DocEntry)
--Check row by row and sumary when U_DifDesc = '01'
Select distinct 'true'
from  ORDR where Docnum = $[$8.1.0] and @conteodescuento >=1
-- trigger true when @conteodescuento >=1

Hi Douglas Marroguin...
Approval Procedure is not possible by the Row wise in the standard behaviour ...
try this work around
http://it.toolbox.com/blogs/sap-library/approval-procedures-line-level-and-header-level-part-1-9662
Hope Helpful
Regards
Kennedy

Similar Messages

  • Using User Defined Function is SQL

    Hi
    I did the following test to see how expensive it is to use user defined functions in SQL queries, and found that it is really expensive.
    Calling SQRT in SQL costs less than calling a dummy function that just returns
    the parameter value; this has to do with context switchings, but how can we have
    a decent performance compared to Oracle provided functions?
    Any comments are welcome, specially regarding the performance of UDF in sql
    and for solutions.
    create or replace function f(i in number) return number is
    begin
      return i;
    end;
    declare
      l_start   number;
      l_elapsed number;
      n number;
    begin
      select to_char(sysdate, 'sssssss')
        into l_start
        from dual;
      for i in 1 .. 20 loop
        select max(rownum)
          into n
          from t_tdz12_a0090;
      end loop;
      select to_char(sysdate, 'sssssss') - l_start
        into l_elapsed
        from dual;
      dbms_output.put_line('first: '||l_elapsed);
      select to_char(sysdate, 'sssssss')
        into l_start
        from dual;
      for i in 1 .. 20 loop
        select max(sqrt(rownum))
          into n
          from t_tdz12_a0090;
      end loop;
      select to_char(sysdate, 'sssssss') - l_start
        into l_elapsed
        from dual;
      dbms_output.put_line('second: '||l_elapsed);
      select to_char(sysdate, 'sssssss')
        into l_start
        from dual;
      for i in 1 .. 20 loop
        select max(f(rownum))
          into n
          from t_tdz12_a0090;
      end loop;
      select to_char(sysdate, 'sssssss') - l_start
        into l_elapsed
        from dual;
      dbms_output.put_line('third: '||l_elapsed);
    end;
    Results:
       first: 303
       second: 1051
       third: 1515
    Kind regards
    Taoufik

    I find that inline SQL is bad for performance but
    good to simplify SQL. I keep thinking that it should
    be possible somehow to use a function to improve
    performance but have never seen that happen.inline SQL is only bad for performance if the database design (table structure, indexes etc.) is poor or the way the SQL is written is poor.
    Context switching between SQL and PL/SQL for a User defined function is definitely a way to slow down performance.
    Obviously built-in Oracle functions are going to be quicker than User-defined functions because they are written into the SQL and PL/SQL engines and are optimized for the internals of those engines.
    There are a few things you can do to improve function
    performance, shaving microseconds off execution time.
    Consider using the NOCOPY hints for your parameters
    to use pointers instead of copying values. NOCOPY
    is a hint rather than a directive so it may or may
    not work. Optimize any SQL in the called function.
    Don't do anything in loops that does not have to be
    done inside a loop.Well, yes, but it's even better to keep all processing in SQL where possible and only resort to PL/SQL when absolutely necessary.
    The on-line documentation has suggested that using a
    DETERMINISTIC function can improve performance but I
    have not been able to demonstrate this and there are
    notes in Metalink suggesting that this does not
    happen. My experience is that DETERMINISTIC
    functions always get executed. There's supposed to
    be a feature in 11g that acually caches function
    return values.Deterministic functions will work well if used in conjunction with a function based index. That can improve access times when querying data on the function results.
    You can use DBMS_PROFILER to get run-time statistics
    for each line of your function as it is executed to
    help tune it.Or code it as SQL. ;)

  • Workflow: purchase order created approve defferent users

    hi friends,
    i am creaed purchase order throw workflow. under that based on release stategy released and cancelld working fine. but our client requirement is  two defferent release codes is  customising one release code <=1000 is approved (current user), and another release code  is =>1000 is approved (another user). so please give me a valuable suggestions.
    advance thanks you.
    Regards,
    Bikshu.

    Hi,
    Based on the release strategy for PO, you can set the agents in config. SPRO - Materials Management - Purchasing - Purchase Order - Release Procedure for Purchase Order - Define Release Procedures for PO's - Workflow.
    Here, based on the release group and release code, you can set the approval agents. This method can be used if your approval agents are fixed and known. If it has to be calculated at runtime, then you have to use other methods and rules.
    Ensure that you have made an entry of 1 in the Workflow column for the appropriate release group and release code under SPRO - Materials Management - Purchasing - Purchase Order - Release Procedure for Purchase Order - Define Release Procedures for PO's - Release code.
    In you step in the workflow, leave the agents as blank when you adopt this method.
    Cheers,
    Satish
    Edited by: Satish Kumar R on Oct 13, 2008 1:55 AM

  • How to create database from scratch using user input

    what I am trying to do is to create database via my java code (using hibernate and my sql) and based on user input.
    The details like the name of table.... or the number of columns in it are all supposed to be determined from user input (only the first time).
    On subsequent run the program should remember the previously created database and hence work with it.
    Can somebody help me through this?
    Suppose I did create it using firing queries from my program then the next problem is how my program would start up next time......?????

    Anuvrat wrote:
    what I am trying to do is to create database via my java code (using hibernate and my sql) and based on user input.
    The details like the name of table.... or the number of columns in it are all supposed to be determined from user input (only the first time).
    On subsequent run the program should remember the previously created database and hence work with it.
    Can somebody help me through this?Presumably because you want to (fun) rather than because you need to (job or project.)
    If the second then don't do it.
    >
    Suppose I did create it using firing queries from my program then the next problem is how my program would start up next time......?????You would start by learning about DDL which is the common name for the languages, which vary by database, used to create the entities that represent the structure of a database. Until you figure out the syntax of that you can't do anything in java.

  • Webi- Issues when using multiple Queries

    Hi All,
    I have a requirement as follows:
    A crosstab which will have Year dimension both in the vertical and horizontal header. How ever the horizontal header should have years chosen by the user.
    And the vertical header should have all the years that belong to that dimension.
                                   2013 2014 2015
    Audit1  2011                N     N      N
    Audit2  2013                Y     N      N
    Audit3  2014                N     Y      N
    For this I am using two queries.
    Query 1 ->Audit Name , Year
    Query 2 ->Year with a multiselect prompt
    But the problem with this is that after exec uting the queries the Year dimension gets merged and gives me a union of all the years.
    Also if I avoid merging the dimensions, it gives up the infamous #DATASYNC error.
    However I want crosstab horizontal header to show up only the selectd years(that are selected using the prompt by the user).
    Please help.

    Hi Pradnya,
    Your approach is really nice towards the requirement.
    I similarly created two queries containing Year and on
    one of the query created a prompt on Year and one query does not have any
    prompt.
    Lets say I have created two queries named [Query 1] and [Query
    2] and my merged dimension Year contains dimensions [Query 1].[Year] and [Query
    2].[Year].
    (Note: Query 2 has a prompt on Year)
    Created a detail variable named [test] which has the
    definition as =[Query 1].[Year] and Associated to the merged dimension [Year].
    Inserted a cross table and used [test] in the vertical
    header and in the horizontal header used the following formula:-
    =UserResponse([Query 2)].[Year];"Enter values for
    Year:")
    Please try the above and let me know how it goes.
    Regards,
    Manpreet

  • Header and item level approval using N level BADI

    Hi Experts,
    I beleive we can use either header level or item level approval workflow (WS14000133 and WS14500015) using N Approval-BADI. Please advise what information approval will be able to see if we will be using WS14000133 (Header level approval). Can he see all line item information or header level only.
    Regards,
    Kamal

    In SRM the same BADI is used for SC, PO, Invoice and others as well..  If you see the example implementation provided by SAP, you can see the use of CASE statement with different Business Objects and code under it.
    Irrespective of the Header level or Item level approval workflow the same BADI has to be implemented.
    The difference between Header and Item Level approval is
    1) In Header level, approval or rejection is done for the whole cart (there can be 1 item or multiple items).
        Approver will be able to see all the items in the cart.
    2) In Item level, approval or rejection is done for each and every line item. here is an example ---
      Line item 1 has Cost Center as Account Assignment Category and has to be approved by Users A and B.
      Line item 2 has Internal Order as Account Assignment Category and has to be approved by Users C and D.
    Item 1 goes to user A and once approved, it goes to B.  they will not be able to approve or reject item 2. but we can restrict user A and B to see item 2 or not by setting a flag..
    Item 2 goes to user C and once approved, it goes to D.  they will not be able to approve or reject item 1. but we can restrict user C and D to see item 1 or not by setting a flag..
    The SC will get released only after all the items are approved.
    For Header Level approval, you need to fill the APPROVAL_TABLE.
    For Item Level approval, you need to make use of APPROVAL_TABLE, ITEM_APPROVAL_TABLE and ITEM_APPROVAL_OBJ.
    Examples provided by SAP might give you an idea how to code for Header and Item Level.
    Hope this gives you some information .....
    Regards,
    PR.
    Edited by: PR on Nov 25, 2008 10:50 PM

  • Query to retrieve all saved user queries?

    Hi,
    In which table are the user queries saved?
    How can I write a query to retrieve all the user created queries?
    I need to copy all the user queries which are implemented in 1 client implementation to a different client's implementation.
    Thanks.

    Hi Rajesh
    Try This query
    select QName,QString from OUQR .
    You can use the quick copy option if you are using SAP version 9 and if lower you can use the copy express addon..
    SAP Business One 9 - Implemenation Center  Quick Copy  
    Hope Helpful
    Regards
    Kennedy

  • Approval Procedure User wise

    Hi,
    can any one tell me is it possible to create approval procedure user wise?
    Scenario is
    Any department can raise purchase order (Requisition) It will go to the relevant head of department for quantity approval, after that it will go to the purchase department for price approval
    Can any one tell me the query
    Regards
    Shashi

    Create seperate approval stages for the users A,B & C.
    In each approval stages set No. of approvals required as 2.
    For the User-A in approval stage,
    Select User-G,Select Department.
    Select User-Y,Select purchase department.
    Similarly create approval stages for Users B & C.
    Also create 3 seperate approval procedures
    for the users A,B & C.
    Link approval stage of user-A with each approval procedure
    for User-GY,Set Orginator as User-A & department,Select
    Purchase Order in Documents Tab,in terms
    Apply condition using query(Istavan).
    Similarly create seperate approval procedures for users
    FY & HY as above.
    Jeyakanthan

  • Filer using user properties in DIAdem

    I added to my channels some user properties which values clarify the context of different channels, saving all channels in different TDM files. Working woth data loaded in the Data Portal or selecting dat for loading I would like to view / compare /process data with specific values of user properties. How can I filter my channels using User Properties content ?
    Thanks
    Luca
    Solved!
    Go to Solution.

    Hello Luca,
    This should be pretty easy.
    In the NAVIGATOR, selected the"Advanced Search" button (little blue icon on the top right side of the NAVIGATOR Window).
    Build the query based on your customer property (in your case a Channel property) in the query builder. If you have numeric properties, you can use ">" "<" ">=" "<=" and "=" for your queries. Queries can be connected with AND or OR, it should be pretty straight forward from there.
    Let us know if you have any additional questions. If you do, it always helps to share your version of DIAdem and a few data files if you can.
        Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • How to use user variable in Member Formula

    Hi All
    I have to write a member formula for %linearity quarter for a weekly application.This member will be used in reports and we do not want to do this calculation in reports, hence need to write member formula. The formula is
    Week1 of Q1 forecast / Q1 Total Forecast , Week2 of Q1 Forecast/ Q1 Forecast.............,Week15 of Q2 forecast/ Q2Total Forecast.......and so on.
    According to me it should work in the below mentioned manner , but need help in improvising the formula.
    If(@ismbr("Weeks1") or @ismbr("Weeks2") or @ismbr("Weeks3") or @ismbr("Weeks4") or @ismbr("Weeks5") or @ismbr("Weeks6") or @ismbr("Weeks7") or @ismbr("Weeks8") or @ismbr("Weeks9") or @ismbr("Weeks10") or @ismbr("Weeks11") or @ismbr("Weeks12") or @ismbr("Weeks13") or @ismbr("Weeks14") )
    "Current_Forecast"/"Q1"->"Current_Forecast";......
    If anybody can help in suggesting how can i use user variable in this formula to achieve the required result.
    Thanks

    Hi
    Thanks for the suggestion and it would be a better idea to use ISIDESC as compared to ISMBR.
    I also wanted to ask if in the below mentioned formula if the result of first line is true than will the second line pick the current_forecast value of the respective member of Q1 and divide it by the current_forecast value of Q1.
    IF(@ISIDESC("Q1"))
    "Current_Forecast"/"Q1"->"Current_Forecast";
    Also i need to know how can i write a member formula for week YOY% using user variables.The general formula is
    Week 1 of FY13 - Week 1 of FY12/Weeks 1 of FY12
    Week 2 of FY13 - Week 2 of FY12/Weeks 2 of FY13 and so on till week 53.
    Thanks

  • Can we use multiple queries on one template

    Can we use multiple queries on one template

    Hi,
    if you're using data templates for your data set, you
    can put multiple queries in the XML data template.
    The queries may then be linked (or not) by the "link
    name" tag ...
    Grtz.Following you answer here...do you know eventually how/if possible to preview a report (with XMLP Desktop) that is using data templates for the data set?
    Thanks,
    Liviu

  • Using user defined variables in SAP BPC 7.0 NW

    Hi,
    I am using BPC 7.0 SP2 NW version. I want to do some calculatioins and/or comparision in the script logic by using user defined variables.
    For Ex: I want to assign the property TIMEID of TIME dimension to a variable and then use this variable in my IIF statement.
    I have tried a lot but not getting any solution.
    Can anyone guide me in how to use user defined variables in Script Logic.
    Your valuable reply is appreciated.
    Thanks & Regards
    Manoj Damle

    Hi,
    Thanks for the valuable reply.
    But i want to define variables in the Script Logic and not in the Data Manager.
    The scenario is like this:
    I want to check the value of the DUMMYACC1 member of GL_ACCOUNT dimension with a constant and depending on the condition i want to update a user defined variable. This variable will further be used in the *SELECTCASE statement for decision making.
    The Code is as follows:
    *XDIM_MEMBERSET COMP_CODE = COMP_CODE_1
    *XDIM_MEMBERSET BUS_AREA = BUS_AREA_1
    *XDIM_MEMBERSET VERSION = VERSION_1
    *XDIM_MEMBERSET CURRENCY = AUD
    *XDIM_MEMBERSET DATASRC = DATASOURCE_1
    *XDIM_MEMBERSET GL_ACCOUNT = SALESREVENUE,PRICE,QUANTITY,DUMMYACC1
    *XDIM_MEMBERSET TIME=2009.MAY,2009.JUN
    *XDIM_MEMBERSET CUSTOMERCATEGORY = CUSTOMER_CAT_1
    *XDIM_MEMBERSET PROFIT_CTR = PROFIT_CTR_1
    *XDIM_MEMBERSET SEGMENT = SEGMENT1
    *XDIM_MEMBERSET MEASURES = PERIODIC
    *FUNCTION PRO(%VAR1%,%VAR2%)
        [%VAR1%].CURRENTMEMBER.PROPERTIES("%VAR2%")
    *ENDFUNCTION
    *FOR %GL_ACC% = DUMMYACC1
        *FOR %CV_TIM% = 2009.MAY,2009.JUN
            #CUR_MTH = IIF(([GL_ACCOUNT].[%GL_ACC%],[TIME][%CV_TIM%]) = 1.,1,NULL)
        *NEXT
    *NEXT
    *SELECTCASE #CUR_MTH
    *CASE 1
        #CURRENTMTH = PRO(TIME,TIMEID)
    *ENDSELECT
    The errors which system gives is:
    1. Duplicate formula found
    2. Invalid MDX statement
    3. #CUR_MTH & #CURRENTMTH is not a valid member
    Please give your valuable suggestion.
    Thanks and Regards
    Manoj Damle

  • How to use user-defined packages in JAX-RPC web service

    I am trying to use Object of my class located in my package in jax-rpc webservice,the code is
    package supercomputer;
    import Hello.*;
    public class SuperImpl implements SuperIF
    public String sendParam(String data)
    Temp ob=new Temp();
    int i=ob.get1(10000);
    return data+"returned by supercomputer";
    Temp is located in Hello package,I have jar the Hello package as Hello.jar and has set its classpath in targets.xml of Ant tool.
    The code compiles well and service is deployed successfully,but when i try to call the service from the client its gives me following error.
    [echo] Running the supercomputer.SuperClient program....
    [java] java.rmi.ServerException: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    [java] at supercomputer.SuperIF_Stub.sendParam(SuperIF_Stub.java:60)
    [java] at supercomputer.SuperClient.main(Unknown Source)
    I dont know if it deploys why it gives error on client side.
    Please tell how to use user-defined packages and class in jax-rpc service code ,i am not talking about passing user-defined parameters i am just talking about making objects of user defined classes in jax-rpc service.I think there is some problem in classpath.
    Please guide me in doing that.
    Thanks,
    Farrukh

    Farrukh,
    I don't know if your error is about a missing class from your custom package, ... what track did you followed to say that?
    To use your package in the implementation of you web service, you should only follow the rules of making a web application: put your package jar in your \lib directory inside WEB-INF/ or your package classes unjared in classes (also in WEB-INF/).
    As I already said, I have doubts that your error should be originated from a missing class from your package, but:
    -try to see the logs (errors?) when you deploy your web service that could give a hint about the problem.
    -try to see if you can access your endpoint through your browser to see if there is a online status
    -display your config/WSDL file, and the steps you did to build your web service.
    regards,
    Pedro Salazar.

  • Change gl account in MIGO by using user exit

    Dear all,
    Could you tell me how to use user exit to change the gl account in MIGO?
    I have searched in SDN and found some code.
    In user exit: MBCF0002 ( EXIT_SAPMM07M_001 ).
    FIELD-SYMBOLS <F2> TYPE ANY."Field Symbol for the GL ACCOUNT
    DATA : W_KONTO_NAME(50) VALUE '(SAPMM07M)DM07M-KONTO'.
    ASSIGN (W_KONTO_NAME) TO <F2>.
    MOVE "GLACCOUNT" TO <F2>.
    "GLACCOUNT" is the new GL account you want to change.
    but thecode doesn't work, it can not change the BSEG-HKONT.
    Could you help me solve this problem?
    Many thanks
    Message was edited by:
            Chen Zhonghua

    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.sap-img.com/ab038.htm
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
    Transaction Code - MIGO                     Goods Movement
    Exit Name           Description
    MBCF0002            Customer function exit: Segment text in material doc. item
    MBCF0005            Material document item for goods receipt/issue slip
    MBCF0006            Customer function for WBS element
    MBCF0007            Customer function exit: Updating a reservation
    MBCF0009            Filling the storage location field
    MBCF0010            Customer exit: Create reservation BAPI_RESERVATION_CREATE1
    MBCF0011            Read from RESB and RKPF for print list in  MB26
    MB_CF001            Customer Function Exit in the Case of Updating a Mat. Doc.
    No of Exits:          8
    Rewards if useful.........
    Minal

  • Prevention of delivery when using "user status profile" for a sales order?

    Hi,
    I have used "user profile status" in the sales order "as a work flow" for releasing the sales order.
    The user profile are as follows
    a) 10: created
    b) 20: Released
    But I believe I am still able to create the delivery when the order status is still "10" created.
    Any advise, user exit or workaround or should this happen.
    Usefull answers will be rewarded.
    Thanks

    Dear Rajiv,
    Please go through this SAP help link it will help you about Status Management in the sales order processing.
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/560629545a11d1a7020000e829fd11/frameset.htm
    I hope htis will help you,
    Regards,
    Murali.

Maybe you are looking for

  • Receiver SOAP Adapter error

    Hi All,          I am getting this response error message in my receiver SOAP Adapter while invoking a synchronous webservice. <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!-- Request Message Mapping   --> - <ProcessMessageResponse xml

  • Vendor Returns Without Purchase Order

    Hi Experts, Is Vendor Returns doing Without Purchase Order and without doing any reversal of material document  possible or not, please provide the details. Regards, Vivek.N.V

  • How do I open attachments, bank statements, etc. w/o downloading?

    I am unable to open attachment in e-mails (Yahoo) or documents online, I have to download and I am not having any success. I'm not computer literate so please give a simple, east to follow correction to this problem. Thanks

  • Bizzare situation withn the "Where used list" for a table

    Hello all, I use the "where used list" (all check boxes selected) function in SE11 to find out where and how the table FMGLFLEXT (same for table FMGLFLEXA) is being used and updated. All I get is a reference to a function module, namely   “G_POSTING_

  • Acoustic beeping from within tower after installing 10.4.8

    Here's an oddity, which the "I hear buzzes" doc page (http://docs.info.apple.com/article.html?artnum=86523) suggests is due to the power supply. This afternoon, I upgraded my dual 2-gig G5 (1.5 gigs of RAM) from 10.3.9 to 10.4, and thereupon ran upda