Can I put formula in a query

I created an infoset (SQ02) and a query (SQ01).  I want to have a new column that computes for the difference of the forecasted sales and actual sales.  Can I do that in a query?

Hello John,
I'm sure it can be done. But you have to take the help of an Abaper to acheive that.
Go to Transaction code - SQ02 (Change mode of the query you have created). Then click on the <b>Extras Tab</b> and use the <b>Code Tab</b> to write the formula you require.
<b>REWARD POINTS IF HELPFUL</b>
Regards
Sai

Similar Messages

  • Can I put confitions in a query?!?

    Hi there,
    Can anybody tell me if there could have something like a conditional query?
    Ok here is the deal.. I have couple of tables where i have the relations between objects, subobjects and sub-subobjects and the status of the sub-subobjects.
    One object can have many subobjects with many sub-subobjects with different status
    object
    - subobject1
    -sub-subobject1
    -sub-subobject1
    I m trying to build a tree which shows img for the status of the subobjects and sub-subobjects.
    The idea is if any of the sub-subobject is "URGENT" the status for the Subobject to this subsubobject to be "URGENT" too.
    How can I make my tree query work like this?
    Any help will be highly appreciated!
    Thanks in advance

    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 25 16:17:01 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    macmilp@xe > with t as (
      2    select 0 id, null parent, 'UK' node, null status from dual
      3    union
      4    select 1, 0, 'Scotland', null from dual
      5    union
      6    select 2, 0, 'Wales', null from dual
      7    union
      8    select 3, 1, 'Fife', 2 from dual
      9    union
    10    select 3, 1, 'Aberdeen', 2 from dual
    11    union
    12    select 4, 1, 'Edinburgh', 1 from dual
    13    union
    14    select 5, 2, 'Dyfed', 3 from dual)
    15  select  lpad(' ', 3 * (level - 1)) || t1.node as node,
    16          (select  min(t2.status)
    17           from    t t2
    18           connect by prior t2.id = t2.parent
    19           start   with t2.id = t1.id) as status
    20  from    t t1
    21  connect by prior t1.id = t1.parent
    22  start   with t1.parent is null;
    NODE               STATUS
    UK                      1
       Scotland             1
          Aberdeen          2
          Fife              2
          Edinburgh         1
       Wales                3
          Dyfed             3
    7 rows selected.Where the urgency of the status is indicated numerically, lowest = most urgent. You can use DECODE or CASE to translate character status codes into numbers and to translate numeric status codes into corresponding img filenames.

  • Can we show comments in adhoc query?

    Hello All,
           Can we put comments in Adhoc query?
           I have a comment icon in infotype 9903.
           I need to fetch that particular comments and show in a query output. It is not a field.
           Can we do this? If yes, then please let me know how?
    Cheers,
    Darshna.

    I did it sometime back. A bit complicated process.
    Create an infoobject, manually enter the values "keyfig1" and "keyfig2".
    Include this infoobject in the filters and restrict it using a "ready for input" variable.
    Now create two formula variables.
    Write a customer exit such that when you select "keyfig1", first formula variable's value should be set to 1 and other one's to 0.
    Then in the query create two calculated key figures, multiply both with the formula variable. Also supress column (all active value == 0).
    Then it will show the key figure which you have selected.
    Pravender

  • Can we use formula column in lexical parameter in sql query ...

    hi
    can we use formula column in lexical parameter in sql query ...
    as example
    i want to give
    select * from & c_table
    forumula
    function c_table
    if :p_sort = 1 then
    return 'dept'
    else
    return 'emp'
    end;
    c_table formula column
    is this possible ...
    i have such example in oracle apps reports
    if i try in ordinary report usinf emp table it show error ..
    how we can give formula column...
    please help me in this regard...
    Edited by: 797525 on Feb 20, 2012 9:31 PM

    thanks sir,
    iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
    &c_source_from and &c_from_cat formula column and there are defined at report level only ......
    pl/sql code &c_source_from is
    function C_source_fromFormula return VARCHAR2 is
    begin
    if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
    else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
    else if :P_source_type_id = 5 then
         if :C_source_where is null then
              return NULL;
         else
              return(',WIP_ENTITIES wip');
         end if;
    else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id is null then
    return(',MTL_SALES_ORDERS      mkts,
    MTL_GENERIC_DISPOSITIONS mdsp,
    GL_CODE_COMBINATIONS gl ');
    else null;
    end if; end if; end if; end if; end if; end if;
    RETURN NULL; end;
    this is forumula column i hope that you understand what iam saying
    please help me in this regard....
    thanking you...

  • Can I put a SQL query into a bind variable and then use it to output report

    Hi,
    Can I put a SQL query into a bind variable and then use it to output report?
    I want to create a report and an item "text area" (say P1_TEXT) which can let user to input a SQL query(they are all technical users and knows SQL very well). Then, I use a bind variable (that text area) to store the SQL statement. Then, I add a submit button and I want to use the following to output the report:
    select * from (:P1_TEXT);
    Do you think it is possible to do that? Any known limitations for APEX in this area?
    Thanks a lot,
    Angela

    You can, but make sure it's what you really want to do. Make sure you are VERY familiar with SQL Injection. Most people who know what it is, go out of their way to prevent SQL Injection. You're going out of your way to allow it.
    You can try using &P1_TEXT. instead of bind variable syntax. Bind variables are one of the best ways to prevent SQL Injection, which is why it's not working for you.
    Once again, I strongly urge you to consider the implications of your app, but this suggestion should get it working.
    Tyler

  • Can we put Join Query with Expdp in Query Parameter

    Dear All
    Can we put join condition like
    A.roll_no=B.roll_no
    in query clause of EXPDP utility of Oracle 10g.
    My parameter file is
    INCLUDE=TABLE:"IN ('A','B')"
    QUERY ="where roll_no between 1 and 100 "
    then it works and export the data. But I want Above condition.
    But when I specify it gives ORA-39001 error.
    If possible, How and Can you specify example.
    Regards
    Nikhil

    Hello,
    Please check if OSS note 858458 is applicable in your case.
    Regards,
    Praveen

  • I can not put the data of a field(LONG RAW) consulted into a item of a data block

    I want to query a field that is LONG RAW(it's a image) and put the data into a item of a data block (in Forms Builder), when i write ":BLOCK.FOTO:=vfoto" i recieve this errors: "bad bind variable ....". How can i put the data of field of my DB and put the data in a item of a data block(in Forms Builder)?.
    I can store a image in a table of my DB, but i want to query a image stored in my DB and put it into anothers table, all this on FORMS BUILDER.

    You have to base the image item on a base table and use EXECUTE_QUERY on that block. You can't do a direct select in PL/SQL into the item

  • Need to raise a restriction that user can not put multiple PO references in PO Number field in Sales Order.

    Hi,
    reference to subject we need a restriction that user can not put different PO reference within an Order. One Sale Order should have one PO reference at Header and Line's of the sales order. Currently what is our issue that all the sales order are created by Quotes from quoting module. Whatever the line items come from quotes into sales order having no PO Number reference with them but when user completing the sales order user puts the PO reference at Sales Order Header which can not be linked or passed on those line items who captured from quotation. Due to this PO reference value difference between Lines and Header system generates multiple AR invoices based on unique PO Number references within an order.
    we need single PO reference per sales order. How can we restrict this if line level PO number reference is different from Header PO number reference that user can not proceed further?
    Regards
    Kaleem A. Bhatti

    Dear Zakir,
    Thanks a lot for your favorable response. The query is solved now by defaulting rules.
    Regards
    Kaleem A. Bhatti

  • Can we put INDEXES on Views if not Is there any way to make it Index bas

    Hi
    I am running a query in which there are several views involved in the join condition Can we put INDEXES on Views in ORACLE 9i if not Is there any way to make it Index based views beacuse the result that i am getting is very slow and is eating like 10gb of the temp tablespace.
    Thanks

    No, you cannot put indexes on a view. Think about what a view is, a stored sql statement. Oracle has no way of knowing what rows are in a view until it actually runs the view. So, even if you could, Oracle would need to run the view to get the rows, build the index, then run your query a second time using the index. Seems counter productive to me. A view can use indexes on the underlying tables if appropriate.
    Generally speaking, I would say that a query that makes use of multiple views is probably really inefficient. Often, you are only looking for one or two columns from a view which may require joining several tables whose columns are of no use in the main query. I would start by re-writing the query using the base tables, and only using those tables that are actually required to answer the question.
    TTFN
    John

  • How can i add formula to waveform data type?

    I want to interpolate my acquired data in terms of voltage to temperature. For this i need to use polynomial equation, but i am not able to directly attach formula node to the waveform data type. I want to know how can i add formula node to waveform data, and then also have it real time.

    One additional thought that may be helpful. Once you get the Y component of the waveform graph you are going to attempt to wire this into a formula node. You can do one of two things with that array. Put a for loop around the formula node and index the array into and out of the for loop. This allows you to do scalar math on the data. It is also possible to index and array in a formula node. The following KnoledgeBase demonstrates how to do this: http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/9d72b6069346942386256a0d00604ed4?OpenDocument

  • Curerency conversion for a Formula in the query designer

    Hi
    I have a ' Financial Loss Formula' in the report. I want to convert this 'Financial Loss' into USD Currency at query designer level.
    Source Currency = SAR
    Target Currency = USD
    So how can i do the curerency conversion for a Formula in the query designer.
    pls let me kow
    kumar

    Hi,
    If you define your query conversion in BW then it is easy to do currency conversion through Bex.What you need to do is use calculated key figure instead formula and do a right click select properties there at the currency translation area you ca select defined currency conversion in BW and your target currency.
    /people/rasim.manavoglu/blog/2007/04/30/currency-currency-currency
    Regards.

  • Creating formula in the Query Designer

    Hi,
    I have a KF which I have to convert in to different unit in the query ( x/data)
    The problem is some of my data in the cube is zero (0) and when I use division, it shows me error (red X) in the query output.( Divide by zero)
    Is there any way to skip this division if the data is zero? How can I set my formula in the Query designer?
    Thanks
    M Kumar.

    Hi,
    Please use the NDIV() or NOERR() function outside of your expression and it will take care of the division by zero.
    See here for details:
    http://help.sap.com/saphelp_nw04/helpdata/en/03/17f13a2f160f28e10000000a114084/content.htm
    Hope this helps...

  • Fox Formula Variable In Query Designer

    Hi Experts,
    I have created 1 variable in fox formula of type VARV and i want this Variable to show in query designer while creating new Variable so that i can replace the Query Variable With Fox Formula by Using Replacement Path.
    While Creating new variable in Query Designer it is not Showing that Fox Formula variable.
    Because i want to use this in WAD While Executing the Planning Sequence.
    Is there any way we could get That Fox Formula variable in Query Designer.
    Regards
    Girish

    Hi Marc,
    While Creating Variable from Query Using Query Properties it is still not Showing That Variable in Fox Formula.
    And My Requirement was to Replace that Fox Formula Variable With Query Designer Variable.
    Please Suggest any Solution.
    Thanks
    Girish

  • Adding a formula in a query

    Hey Guys,
    I am trying to add a formula in my query, i have the asset acquisition value and the accumulated depreciation value in different columns. I want to get column A - column B in column C.
    How can i do this?
    Thanks,
    Zaid

    The fields that you want to use in the calculated field will need to be included in the Field Selection list in your query (I don't think you have to include the fields in the query output, but they do need to be available in the Field selection).  
    After reading your reply, I realized that I forgot a step... sorry...  After going into the Field Selection, but before creating the local field, you will need to assign short names to the fields you want to use in the calculation.    To assign short names, you'll first need to turn on the short names column, if it's not already displayed.  Select Edit -> Short names -> Switch on/off.  Find the  fields to be used in the calculation.  For each field, enter a unique name in the short name box next to the field.
    Once you've assigned short names, you can create the local field.  Use the short names for the fields in the calculation.  And after you've created the local field, be sure to assign it to the query output.
    Regards,
    Shannon

  • BI Auth - user still can search & execute for not authorized query

    Hello All,
    need your help here.
    For BI security,
    I've configured menu role (for example ZBEX_FIN) in order for the end users to see only specific queries/workbook inside the menu folder that assigned to him/her.
    And I've made a function role for end user, copy from the template S_RS_RREPU with the modification:
    1. I delete 0BI_ALL
    2. add S_USER_AGR and put my menu role above (ZBEX_FIN) for field ACT_GROUP
    3. add S_RS_FOLD to disable the infoarea button in BEx.
    currently the user can see and execute report assigned in the role menu folder, this is correct.
    But the problem is there's a find button in the BEx, when the user try to search other query (non authorized query,the one that supposed he can't see), he still can display the query, then can execute the query. This is not acceptable.
    Anyone can suggest whether I can disable the find button in the BEx
    or any other restriction in the role that I missed, so the user can only execute and display the query/workbook under the role menu only.
    Thanks in advance.

    So it means that we need to do it twice restrictring the query in the role menu and then inside the S_RS_COMP ?
    so later when the user wants to add more queries in his role, we need to add those in the role menu as well inside the S_RS_COMP. is this correct ?
    When you add queries/workbook to role menu, you are not restricting the access. Its just that user menu would list those queries/workbooks. Users can search for other queries and workbook and run them with proper authorizations in S_RS_COMP. You may consider maintaining query naming convention with wild cards for example YRZ* etc to give access to all queries/workbooks starting with YRZ. This would save your effort to update role too freqeuntly.
    And if I have a workbook, how I put it inside the S_RS_COMP ? because the component of S_RS_COMP is query only.
    S_RS_COMP can restrict queries as well as workbooks with field RSZCOMPTP= REP

Maybe you are looking for