Query for Auto Calculation based on input of 2 Fields

Hi,
I would like to write a sql query to allow for auto calculation based on the Inputs of 2 other fields before Adding the Order.
For example. A query on Sales Order where I have Item 040634 (Code for a Flower) and Quantity 200.
I have a UDF (Bunching) where the value is 10, 15 or 20.
Based on the Bunching the result should be given in another UDF (Noofsleeves).
(Quantity) 200 / (Bunching) 10 = 10 (Noofsleeves)
The Order will be having multiple items where the Bunching can differ for each item.
Is it also possible to remove the calculated noofSleeves from Inventory.
I am using 2007A SP01 PL05

Hi ,
You may try this: Apply this fms on other udf and auto refresh on the udf mentioned in the query (in your case Bunching).
SELECT $[RDR1.Quantity.number] / $[RDR1.U_UDF.number]
You may check these too.
cALCULATION OF udf ON UNIT PRICE
FMS
Thanks,
joseph
Edited by: Joseph Antony on Jul 8, 2010 12:31 PM

Similar Messages

  • In BI how to filter the selection options based on inputs on top field

    Hi Friends,
    In BI, How to filter the selection options based on inputs on top field.
    The system should automatically filter the lower level drop downs based on the selection of a higher level.
    For e.g. :
    If a user selects a Country then the States drop down should only display the State's belongs to the Country. Similarly when a State is selected, the District drop down should display only those District's belongs to the State.
    Thanks in Advance.
    Regards
    Jayaram M

    Hi Anil,
    Thanks for reply but I couldn't use Compounding Characteristic here. Need some other solution.
    Regards
    Jayaram M

  • Query for MAP Calculation - Price Control ind V and S

    SAP Guru's
    Query regarding MAP Calculation Logic
    Scenario:
    *I have one material xyz
    1. It is split valuated material,
    2. Two valuation types with diff price control indicators
    3. Batch Management is also activated on this material.*
    Follwoing is the Material Master Accounting1 View :
    Vauation Type     Price Control     Total Value     Qty     MAP                  Batch     
         ZA1          V                     610835.00             37     16509.05(V)          01
         ZB1          S                     0                  1     20000.00(S)          02
    but when we are running MM03 w/o Valuation Type Accounting 1 View
    is showing MAP as 16074.60 i.e. 610835.00/38
    Diff. Reports Output------>
    MB5L - List of Stock Values: Balances --> Output
    ValArea          Total Stock          Total Value
    A101               1                          0
    A101               37                          610835.00
    Net-->               38                  610835.00
    MB52 - Display Warehouse Stocks
    Check Box - Display Batch Stocks
    Condition1: When Display Batch Stocks is selected on main screen of MB52
    Mat.     Palnt      Sloc      Unrestricted     Stck in Transit          Total Value
    xyz     A101     0010      0                    30                       482238.00
    XYZ     A101     0010      7                    0                       115563.00
    xyz     A101     0010      1                    0                        0
    This is not correct result as Total Values is 597801.00 only      
    Condition2: When Display Batch Stocks is not selected on main screen of MB52
    Mat.     Palnt     Sloc     Unrestricted     Stck in Transit          Total Value
    xyz     A101     0010         0                  30                       482238.00
    XYZ     A101     0010         8                   0                       128597.00
    This is correct result as Total Values is 610835 .00 only
    So my query on above issue is :
    1. How System is including 1 Qty of Std Price Control for MAP calculation?
    As per my understanding MAP is only for Price Control V indicator Materials Stock
    2. Whats the difference between these two report output from MM03 Accounting
       view?
    Thanks

    hi Animesh,
    For Split Valuated Material at header level Price control is always "V" i.e. Moving average price reagrdless of the Price control you have given for different valuation types.
    Due to this you are getting these kind of results. Please visit the following link for more information
    http:///saphelp/EN/8f/d1de34e4cb2300e10000009b38f83b/frameset.htm
    Check it and revert back.
    Regards,
    Jay
    Edited by: SAP_MM on Dec 4, 2008 10:19 AM

  • Query for tax calculation.

    Hi All
    I want to know if it's possible to do calculation using the unit price field in Purchase Order.
    This is what I want to test
    I insert unit price then select the Taxable UDF option (Yes) then the Total(LC) Field ( Standard B1 field must display the amount plus 14% vat and when I select Not taxable it must not apply the 14 % vat.
    The reason why i'm doing this is the client is not a vat vendor ( they dont have to report for tax) so this is just a workaround that i have to expense the whole amount.
    And how to use variables when you want to write a query... like (unit price x 0.14)
    Please any suggestions are welcome.....
    Thanks
    Bongani Dlamini

    Hi Gordon
    "However, the problem start here: how will you use this query result?"
    The calculated amount must appear in the line total field as this field is used for document totaling.
    " Do you want the document total relate to your results?"
    The document total must display the total amount inclusive of VAT , the VAT field must not include any info
    Thanks
    Bongani

  • How to execute the query for a block based on the parameter

    Hi All,
    Good evening.
    i have requirement where i need to display the data in one block based on the selected items.
    the scenario is like this...there are 2 LOV's and one apply button and one external region on the form.
    so when u select the lov values and click on apply button the query should execute based on this 2 lov values.
    i am not getting how to achieve this..i am very new to oracle forms..
    Please Help..
    Thanks
    Bharat
    please help..it is urgent..
    thanks
    bharat
    Edited by: Bharat on Jan 31, 2012 5:19 AM

    Bharat wrote:
    Hi All,
    Good evening.
    i have requirement where i need to display the data in one block based on the selected items.
    the scenario is like this...there are 2 LOV's and one apply button and one external region on the form.
    so when u select the lov values and click on apply button the query should execute based on this 2 lov values.
    i am not getting how to achieve this..i am very new to oracle forms..Another way you can do this. Create a lov and don't assign it to any column just one return item (should be id).
    Now create a button may be your "apply button" write two trigger when-button-press and when-mouse-click.
    at When -Button-Press trigger, change the block state to 'ENTER-QUERY' and at when-mouse-click show the LOV and then write execute_query.
    Hope this will help you.
    If someone's response is helpful or correct, please mark it accordingly.

  • How do I add auto text based on value in numeric field?

    Need help... I'm trying to add auto text to a text field based on a value in a numeric field. I want my text field (summary box) to say "Passed" if the value (score box) is equal to 10 and the field to say "Not Passed" if the value is equal to less than 10. My numeric field is being calculated by selecting drop-down lists.
    Thanks in advance for your help.
    Ed Watson
    Here's a link to the document I created...
    https://files.acrobat.com/?trackingid=KGLIT#folder/c3106c32-2e69-4a5f-8ef2-94d25623dbfb

    I think I figured it out.  I used the following script:
    if(NumericField1.rawValue ==1){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==2){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==3){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==4){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==5){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==6){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==7){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==8){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==9){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==10){TextField1.rawValue = "Passed"}
    There's probably a cleaner way to do the same thing but at least this works for now.  Hope this helps someone else.

  • Need to hide the field based on input to other field on screen

    Hi All,
    I enhanced the std. infotype 1029.Now I need to display one custom field only if another custom field (check box) is enabled, otherwise no.
    I tried writtinf code in PBO of ZP102900 in subscreen 0200.
      loop at screen.
      if screen-name = 'fld1'.
        if 'fld1' = 'X'.                      -
    >if chk box is selected then it shud display the fld2 on the screen along with fld1
          screen-name = 'fld2'.
        endif.
      endif.
      endloop.
    But no results:-(
    Can you please help me out in this ASAP.
    Thanks in advance.
    Regards,
    Ashwini

    Hi All,
    Finally I got the results:-)
    Solution:
    in PBO module:
      LOOP AT SCREEN.
        if SCREEN-NAME = 'P1029-<FLD2>'.
          IF P1029-FLD1 = 'X'.
            SCREEN-ACTIVE = 1.
            MODIFY SCREEN.
          ELSE.
            SCREEN-ACTIVE = 0.
            MODIFY SCREEN.
          ENDIF.
        endif.
      ENDLOOP.
    in PAI module:
    LOOP AT SCREEN.
      if SCREEN-NAME = 'P1029-<FLD2>'.
          IF P1029-<FLD1> = 'X'.
            SCREEN-ACTIVE = 1.
             MODIFY SCREEN.
          ELSE.
            SCREEN-ACTIVE = 0.
          ENDIF.
      endif.
    ENDLOOP.
    Thanks for your valuable time.
    Regards,
    Ashwini

  • Make a field required based on input in another field

    So I have researched the forum to answer the question of how to make certain fields in a form required if a value is entered in another designated field, and not required if no value is entered in the designated field.
    For example:
    There is a field titled QTY_paper, and if a value is entered into QTY_paper, then the field PROGRow1 should become required.
    If no value is entered into QTY_paper, then PROGRow1 is not required.
    I've tried both FormCalc and Javascript, but with no results. In FormCalc I added this script as a mouseExit event on QTY_paper:
    if ($.isNull == 0) then
         //Make the budget field Required
         PROGRow1.validate.nullTest = "error";
    endif
    and then I added this script in FormCalc to the mouseExit event on PROGRow1:
    if ($.isNull == 0) then
    $.validate.nullTest = "disabled"
    endif
    This came almost verbatim from another post on the forum, so I'm thinking I'm missing something obvious here... which isn't too odd as I'm still pretty new at adding the scripts. Please help if you can!

    You'd want to combine both scripts on the first field with an if/else statement. And I'd use the Exit event instead of Mouse Exit (not sure if Mouse Exit handles tabbing in and out of fields).
    The first script should have worked, but with the second script you were asking if PROGRow1 was null, not QTY_paper.
    FormCalc:
    if ($.isNull) then
         PROGRow1.validate.nullTest = "error"
    else
         PROGRow1.validate.nullTest = "disabled"
    endif

  • Using Javascript to show/unshow a field based on input in another field

    I want to display/not display a field in a JSP depending on what is selected in another field.
    I am using <div></div> element currently which is displayed/not displayed using a Javascript invoked by the first field.
    the problem with div is that I have to put it inside a <tr><td> otherwise it doesn't work. This makes the field look aloof from the rest of the page, and is also not aligned with the other fields.
    Is there anything other than <div> that can be used? or is there a way to correct the look of the field inside a div?
    Thanks

    You shouldn't have to put it inside a <tr><td> to get it to work. I've done what you are trying to do with <span></span> and it worked fine. I haven't tried it with a <div> but I can't image why that wouldn't work. Maybe you could post your code.

  • Query - Remove duplicate records based on value of  one field

    Hi,
    Pleae see the data below,
    how to remove records when its count 0
    AND those records (name ) repeat with count > 0
    existing data
    name                       loc                            count
    aaa          a1          10
    aaa          a1          0
    bbb          b1          0
    ccc          c1          0
    dcc          d1          11
    dcc          d1          0
    required output
    name                       loc                            count
    aaa          a1          10
    bbb          b1          0
    ccc          c1          0
    dcc          d1          11
    remove these records -
    aaa          a1          0
    dcc          d1          0Thanks.

    i assume that loc always corresponds to name. So to find the rows to remain is just a simple group by
    with data as(
    select 'aaa' name,'a1' loc,10 count from dual union all
    select 'aaa','a1',0 from dual union all
    select 'bbb','b1',0 from dual union all
    select 'ccc','c1',0 from dual union all
    select 'dcc','d1',11 from dual union all
    select 'dcc','d1',0 from dual )
    select
      name
    , loc
    , max(count) cnt
    from data
    group by
      name
    , loc
    order by
      name
    , loc
    NAME     LOC     CNT
    aaa     a1     10
    bbb     b1     0
    ccc     c1     0
    dcc     d1     11to find the other is just a minus
    with data as(
    select 'aaa' name,'a1' loc,10 count from dual union all
    select 'aaa','a1',0 from dual union all
    select 'bbb','b1',0 from dual union all
    select 'ccc','c1',0 from dual union all
    select 'dcc','d1',11 from dual union all
    select 'dcc','d1',0 from dual )
    select name,loc,count from data
    minus
    select
      name
    , loc
    , max(count) cnt
    from data
    group by
      name
    , loc
    order by
      name
    , loc
    NAME     LOC     COUNT
    aaa     a1     0
    dcc     d1     0so a delete would be
    delete from data
    where
    (name,loc,count)
    in
    (select name,loc,count from data
    minus ..regards

  • FMS Query for Calculation

    Hi Experts,
    I would like to write a FMS  query to allow for auto calculation based on the Inputs of 2 other fields before Adding the Sales Order.
    For example. A query on Sales Order where I have Item ABCD  and Quantity 200.
    I have a UDF named Abatement where the value is fixed 35%. And other is Assessable Value fixed with MRP Price say 350
    And based on the result should be given in Assessable Value field.
    Formula is  Assessable Value fixed  350 then Abatement  35 %  = 122.50 and then 350-122.50 =      227.50  should be displayed in the Assessable value field.
    Kindly provide me the solution for the query.
    Regards
    Amol

    Hi,
    Try this:
    SELECT  ((select $[RDR1.U_AssessableValue]) - ((select $[RDR1.U_Abatement]) * ((select $[RDR1.U_AssessableValue])/100)))
    Please post screen shot sale order window with UDF filed and values.
    Thanks & Regards,
    Nagarajan

  • Help with Auto calculations

    I have an existing pdf that i am trying to edit and make it more functional...i.e. fillable info with auto calculations of cost based on a given number (times a specific cost)
    Example on the form....
    Car Registrations (per car) _____ X $25 _________
    The first line above is # Cars Registered
    The last line is Total Cost
    The blank lines above i have added a text box to for auto calculations. I have formated these boxes as numbers (first line) and dollar value total (second line)
    I've added another text box for the $25 and placed it overtop the worded one. I've locked this box and the total box. I've calculated the product of the total box by linking it to the first line and the $25 to give the total cost...
    Problem is, it isnt working....the total box isn't seeing the $25 to give a proper calc. Whatever number i place in the first line, only zero shows in the total.
    I'm obviously missing something....been at this for two days....frustrated. I have many more inputs like this on the form, and eventually want all the totals to provide sub totals and a grand total. I understand how this all works to a degree, doesnt seem that difficult, but i have to be missing something.
    I even tried re-creating the document in word, input to adobe, make a new form, let the system recoginize areas as fillable, etc, etc, etc. When i get to the calculations portion, same result...there are not many tutorials out there on this...sadly
    Woking on a MAC...
    I have acrobat X Pro

    gr8snkbite wrote:
    I have an existing pdf that i am trying to edit and make it more functional...i.e. fillable info with auto calculations of cost based on a given number (times a specific cost)
    Example on the form....
    Car Registrations (per car) _____ X $25 _________
    The first line above is # Cars Registered
    The last line is Total Cost
    The blank lines above i have added a text box to for auto calculations. I have formated these boxes as numbers (first line) and dollar value total (second line)
    I've added another text box for the $25 and placed it overtop the worded one. I've locked this box and the total box. I've calculated the product of the total box by linking it to the first line and the $25 to give the total cost...
    Problem is, it isnt working....the total box isn't seeing the $25 to give a proper calc. Whatever number i place in the first line, only zero shows in the total.
    I'm obviously missing something....been at this for two days....frustrated. I have many more inputs like this on the form, and eventually want all the totals to provide sub totals and a grand total. I understand how this all works to a degree, doesnt seem that difficult, but i have to be missing something.
    I even tried re-creating the document in word, input to adobe, make a new form, let the system recoginize areas as fillable, etc, etc, etc. When i get to the calculations portion, same result...there are not many tutorials out there on this...sadly
    Woking on a MAC...
    I have acrobat X Pro
    I created your sample.
    name the field after Number  of cars, as car
    The calulation field named total

  • Item Code Auto Generation Based on User defined Tables

    I need the Item code like
    PRODUCT TYPE-ITEMGROUP-ITEMCODE-SUBITEM-BRAND-COLOR  e.g .FG-01-01-00-001-00.
    I created the following User define Tables and link to Item Master data
    U_PRO             - FOR PRODUCT TYPE
    U_GROUP        - FOR  ITEM GROUP
    U_ITEMCODE    - FOR ITEMCODE
    U_SUBITEM       - FOR SUB ITEM
    U_BRD              - FOR BRAND NAME
    U_COLOR         - FOR COLOR
    i need a formatted search in Item code to fetch the codes from the user defined  table
    i tried with the following
    SELECT T5.[Code]'-'T2.[Code]'-'T3.[Code]'-'T4.[Code]'-'T0.[Code]'-'T1.[Code] FROM [dbo].[@BRD]  T0 , [dbo].[@COLOR]  T1, [dbo].[@GROUP]  T2, [dbo].[@ITEMCODE]  T3, [dbo].[@SUBITEM]  T4, [dbo].[@PRO]  T5 INNER JOIN OITM T6 ON T5.Code = T6.U_PRO WHERE
    T5.[Code] = T6.[$U_PRO] AND 
    T2.[Code] = T6.[$ U_GROUP] AND
    T3.[Code] = T6.[$U_ITEMCODE] AND
    T4.[Code] = T6.[$U_SUBITEM] AND
    T0.[Code]  = T6.[$U_BRD] AND
    T1.[Code]  = T6.[$U_COLOR]
    showing errors. Can any one help me regarding this. I badly need the query for Auto generation of Itemcode

    Hi,
    How can you assign those UDF value without ItemCode in the first place?
    Thanks,
    Gordon

  • Process on value request in Dialog screen based on value of screen field

    Hello Gurus,
    I have a check box on a dialog screen. If the checkbox is checked, based on that I want the other field on the same dialog screen to follow logic for F4 dropdown.
    Now I know if I want to write this, I have to write this in Process on value-request. But how do I get the value of the check box checked or not on the same screen in Process on value-request.
    If it had been a simple selection screen I would have defined the check box as
    Parameter: v_checkbox as checkbox user-command uc1.
    But how do I handle above situation in dialog screen case ?
    Please help.
    Regards,
    Jainam.
    Edited by: Jainam Shah on Sep 29, 2009 6:19 PM

    Hi Shah,
    You have the addition for MODULE statement as ON INPUT.
    Eg :  FIELD <screen field> MODULE <module> ON INPUT.
    You can give the check box field name in the above statement.
    If you want to find as soon as the check box is checked, you can find it here.
    Or else, in the addition ON REQUEST
      you can see for the check box field value whether it is checked or not.
    Thanks,
    Prasad

  • MDX calculation based on date logic for the Jan 1 of current year through the 15th of the previous month

    Hello, 
    We need some help with an SSAS MDX query based on date logic. One of the problems is that I don't have access to the Cube but have been given a query example with the logic needed for the calculation. Here's the scenario; 
    The ETL process will run on the first Tuesday after the 15<sup>th</sup> of a given month. The Analysis Cube data queried should include the current year up to the end of the previous month. For example, on May 19<sup>th</sup>
    (the first Tuesday on or after the 15th) the query should include data from January 1<sup>st</sup> through April 30<sup>th</sup>.
    The 15<sup>th</sup> of the month is not part of the query, it is a factor in when the query is run. The query will always be in terms of complete months.
    SELECT
                    NON EMPTY { [Measures].[Revenue Amount],
                    [Measures].[Utilization],
                    [Measures].[AVG Revenue Rate],
                    [Measures].[Actual Hours] }
    ON
                    COLUMNS,
                    NON EMPTY { ([dimConsultant].[User Id TT].[User Id TT].ALLMEMBERS * [dimConsultant].[Full Name].[Full Name].ALLMEMBERS * [dimConsultant].[Employee
    Type].[Employee Type].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION,
                    MEMBER_UNIQUE_NAME
    ON
                    ROWS
    FROM
                    ( SELECT
    ( { [dimDate].[Week Date].[1/4/2015], [dimDate].[Week Date].[1/11/2015], [dimDate].[Week Date].[1/18/2015], [dimDate].[Week Date].[1/25/2015], [dimDate].[Week Date].[2/1/2015] } )
                    ON
                                    COLUMNS
                    FROM
                                    ( SELECT
    ( { [dimIsBillable].[Is Billable].&[True] } )
                                    ON
    COLUMNS
                                    FROM
    [SSASRBA]
    WHERE
                    ( [dimIsBillable].[Is Billable].&[True], [dimDate].[Week Date].CurrentMember ) CELL PROPERTIES VALUE,
                    BACK_COLOR,
                    FORE_COLOR,
                    FORMATTED_VALUE,
                    FORMAT_STRING,
                    FONT_NAME,
                    FONT_SIZE,
                    FONT_FLAGS

    Hi Hans,
    Thank you for your question.  
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.  
    Thank you for your understanding and support. 
    Regards,
    Simon Hou
    TechNet Community Support

Maybe you are looking for

  • My itouch is not working  when i touch the screen nothing happens it does not respond

    my ipod does not respond when i try to slide to unlock it does nothing  like if the  thouch part does not work   y  is this happening?????

  • Printing from a Sharp AR-207 printer

    My wife inherited a Sharp AR-207 print/fax/scanner. I'd like to use it, but can't seem to find a driver for it. It is set up for wireless printing, someone at the company was using it (on Windows, still have to make it work on her Vista machine... Pl

  • All firefox buttons are unseen and I cannot figure out how to retrive them

    While personalizing my home page @ Firefox, somehow I managed to make all the regular buttons disappear. The buttons I am talking about are "bookmards, history, tools etc. I would like to know how I can recover these buttons.

  • Info about CRM 2005s SPS 08

    Can anyone help me with understanding CRM 5.0 in conjunction with SPS 08. What are the different SPS levels available or is this what is enough for CRM 5.0 if we want to integrate with Portals 2004s Thanks in advance Guest 01

  • Lost serial number info

    I bought FCE new about 4 years ago for my power mac. Then I upgraded to FCE HD about 2 years ago. My power mac died a year ago and I just now bought a new iMac. Unfortunately I cannot find the serial number info to install FCE onto my new iMac. Am I