Changing values based on input

I have a form with a input field labeled Single Qty and a
field labeled Unit of Measure, which defaults to EACH.
We have addes a new field labeled Multiple Lots Qty.
What needs to happen now is that if an entry is made in the
Single Qty field, the Unit of Measure remains EACH. If an entry is
made in the Multiple Lots Qty field, then the Unit of Measure
should change to LOTS.
How do I do this ?
Thanks

"If I input a value into the multiple lots qty, I want the
unit of measure to be replaced by Lots, in the unit of measure
field, before the form is submitted.
I know the unit of measure can be determined after the form
is submitted, but I need it to display on the form before it is
submitted, if possible. "
If you want to change the values "before" the form is
submitted, you need to use javascript..
If you dont understand how to use
document.myform.formname.value, then I would reccommend learning
some basic javascript before you start writing code with it.

Similar Messages

  • Changing value of one input field based on other.

    Hello All,
    I am having this interesting situation with changing a value of a INPUT form in jsp based on another INPUT.
    Lets say my form has 3 INPUT variables.
    1. YEAR (COMBOBOX) (using the SELECT OPTION)
    2. MONTH (COMBOBOX)(using the SELECT OPTION)
    3. TEXT
    If the user sets the year to 2003, I want to show all 12 months. But if the user sets the year to 2004, I want to show only the month of Jan and then not allow the user to change the value.
    I also need both these values to go as form input when the user hits submit.
    After reading the JSP/Javascript issues other people are having with regard to accessing variables across these two(i.e jsp and javascript), it looks like ther is no easy way to achieve this using
    "onChange=setValue()" on the YEAR field.
    What would be the best way to do this?
    Thanks,
    Chhaya

    u can use javascript funtion
    u can pass day month and year wiich will return false if wrong date was selected like leap year,selecting 31 feb etc.
    function validatedate(dd,mm,yy)
              cday=dd
              aday=dd
              cmonth=mm
              cyear=yy
    leapyearcal=cyear%400
              if(leapyearcal==0)
                   leapyear="OK"
              else
              {     leapyearcal=cyear%100
                   if(leapyearcal==0)
                        leapyear="no"
                   else
                        leapyearcal=cyear%4
                        if(leapyearcal==0)
                             leapyear="OK"
                        else
                             leapyear="no"
              if ((cmonth==1)||(cmonth==3) || (cmonth==5) || (cmonth==7) || (cmonth==8)|| (cmonth==10) || (cmonth==12))
                   aday=31
              if ((cmonth==4)||(cmonth==6) || (cmonth==9) || (cmonth==11))
                   aday=30     
              if ((cmonth==2)&& (leapyear=="OK"))
                   aday=29
              else if (cmonth==2)
                        aday=28
              if (cday>aday)
                        return true
              else
                        return false
    }

  • Populate a another value based on input value using abap webdynpro

    Dear All,
    I am new to WDA.I have a requirement to calculate priciple amount based on the user requested amount.Here requested amount is input field and principle amount is defined as text view.
    Now let's say user entered requested amount as 12000,dynamically priciple amount has to be generated by calculating requiredamount/120(number of months).Pls help!
    Thanks,
    Reddy.

    Thanks ,I am able to do it before watching u r answer.I searched in forum and I was able to it.
    Now i have one more question.Now I want to retrict the user not to enter any amount beyong eligible amount.Eligible amount is the field which I am getting from database table and displaying in a text view and the eligible amount is different for different users.I know this validation also has to be handled in ONENTER event.But I am not sure how to show the alert?
    I have to code in ONENTER event handler like
    if lv_requiredamount>lv_eligibleamount
    what need to be done to show some alert are popup.
    Please help.
    Thanks,
    Reddy.

  • Change Value based on Dynamical Object

    Goal:
    The goal is to make the variable with value '2014-06-14 09:00:00.000'
    Problem:
    The syntax code is created as a dynamical object how do you make it from '2014-06-14 16:20:10.000' into value '2014-06-14 09:00:00.000'?
    DECLARE @a datetime = '2014-06-14 16:20:10.000'

    Are you looking for this?
    DECLARE @a datetime = '2014-06-14 16:20:10.000'
    select dateadd(hour,9,convert(datetime,convert(date,@a)))
    set @a = '2014-06-14 08:20:10.000'
    select dateadd(hour,9,convert(datetime,convert(date,@a)))
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Report titles should change dynamically based on input

    Dear Experts,
    I developed the Customer Feedback Quarterly Report. Here i need three dynamic titles.  I Developed the selection screen by using variables for Quarter,Year,Profitcenter,Fiscvariant.Here in my report i have two columns like quarter and cumulative for the year.suppose if i select Quater 2 then july,august,september data will display under quarter column and April to september data(Cumulative data) will display in cumulative for the year column. Now, here i need three dynamic titles for my report.suppose if i select Quarter 2 then in first heading i need the name of the report for the quarter of year (EX: Customer Feedback - FTA For The Quarter 1 of 2008) I acheived this by using Text variable.
    2. As second title i need (Quarter From July To September ) if i select quater 3 it should dynamically change for all the quarters.In the same way for year also (Year From April To September) how to acheive This?
    Could any throw some light on this.
    Thanks,
    Sony

    Hi Sony,
    Check the link :-           https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f002c608-
                                       2533-2c10-25a1-d0e7f7b5b662
    Hope it helps,
    Thanks,
    Uday

  • Changing a boolean value based on two buttons

    I know that this is a ridiculously simple question, but I've been having trouble with it.
    How would you set a boolean value based on the input from two other boolean values? Essentially what I want, in pseudocode, is this:
    boolA = true
    if (boolB)
         boolA = false
    if (boolC)
         boolA = true
    It should be really simple to do, but I can't figure it out. The problem is getting it to stay false, for example, after boolB goes back to false, and not just to have it only momentarily go to false. I want it to stay false until boolC goes to true, regardless of what boolB does after that. Any advice?
    Thanks,
    Logan Williams

    I would say implies is close to what was asked for.  However, the only issue is that for the case where both B and C are false, the logic shows that there is no change to A.  It is initially True, but if it happens to be False because of further changes, there is nothing in the If statements to change the logic.  And that is what is asked for.  That the Result stays False even when B goes back to False.  But the Implies function says that  F and F must be True.
    As described
    B         C         Result A
    T          T          T (because C is evaluated 2nd)
    T          F          F
    F          T          T
    F          F          x (initially T, but the code shown and what is asked for is actually no change from previous state)
       Implies Truth Table
    B         C         Result A
    T          T          T
    T          F          F
    F          T          T
    F          F          T

  • User wants to get the cumulative values based on his input.

    Hi
    I am working one FI Report; the out put values are Cumulative values for Current, Previous years. I developed and it fetches the data last 3 years Cumulative year’s data without any input FYMonth based on SAPexits and varible offsets. But user wants to put Fiscal year Month as input. So he wants get the cumulative values based on his input. For example, If his input SEP'2005(062005), Then Query gives the Output Cumulative Value (I.e., Sum of Total values of Form APR'2005 to SEP'2005)
    Please provide the solution…
    Thanks
    Mannev

    Mannev,
    You can try doing this.
    1. If the user input is fiscal period(2005006) , you can create a customer exit variable which will take the user value (i_step =2), and change the variable value to 20005001. (this is a simple code where tye last 2 digits are replaced by 01).
    if the user is entering calmonth, you can use FM - DATE_TO_PERIOD_CONVERT, to convert the month to fiscal period.
    2. You can create a rkf with restrictions on time char based on the customer exit variable and the user entered variable.
    -Saket

  • Search Fields value based on the input.

    Hi Experts,
    I was trying to develop a web dynpro with two  input-fields and process the logic based on the input-fields.
    The scenario is,have two Input fields, the value for the first input-field a static search help is assigned and for the second input-field the value are populated on the based of the values selected in the first input-fields.
    so here the values for second input-field depends on the first input-field.
    Please put in your thoughts or suggestion for the scenario.
    Thanks
    Best Regards,
    Lalitkumar.
    Moderator message: wrong forum, please post again in Webdynpro forum.
    Edited by: Thomas Zloch on Jul 9, 2010 1:36 PM

    Please refer the following for achieving the same.
    http://wiki.sdn.sap.com/wiki/display/Snippets/OVSsearchhelp

  • How to change the value from one input control to another input control?

    Hi Experts,
    I want to change the value from  one input control to another input control. For Example if i change month in first tab. it should reflect in second tab also. How should we acheive through input control or some other option.
    Here I attached screen shot.Please help me for this

    Hi,
    It is not possible to have Input controll in all tabs that will be set from another .
    But There is one workaround .
    Follow the link below .
    http://davidlai101.com/blog/2013/08/13/web-intelligence-input-control-that-affects-all-tabs/

  • Change Value A based on Value B in Web UI in cross component

    Hi Friends,
    I have a requirement to populate value A based on selection of value B in differenet component.
    I have a web ui screen to create a complaint ( Component A ). After saving when I am clicking on follow up button, it will take me to next web ui screen ( Component B ) i.e. service order. Here I have a status field and after its selection when I have save. I also want to change value A of component A field.
    Kindly suggest..how can I achive this.
    Regards,
    Narendra Goyal

    Hi Narendra,
    It depends on what the exact fields are. If you change a value in component A and this change goes to the BOL layer, then this changed value should always be accessible in component B if you use the same BOL object and BOL relation to access the data. And you can always change the value from component B and it should already change in component A. The only thing you need to ensure is to call publish_current( ) method on the node where you change the value or call a BOL code modify( ).
    Regards,
    Shiromani

  • Fetch records from Database based on Input value

    Hi Experts,
    In my mobile application, I have designed one input field with F4 help or input assist. I need to fetch records from database based on that input and need to display records in table.
    My question is:
    How to fetch the records from database/back end based on the input value and display them as table format as we are doing in SAP ABAP?
    Here, I need to fetch the records based on input value available in the UI screen and pass that value to gateway, fetch the records from database and need to bind with table in SAPUI5.
    Kindly share the whole process flow with sample code for this requirement. Hope I have explained the requirement in detail.
    Thanks In Advance..
    Regards,
    Arindam Samanta.

    Hi,
    Try something like this.
    In this, I am passing From date, To date, RelGrp, RelStr, Uname as input. Then I am storing those values in variables and passing this data in Odata request.
    OData.read({ requestUri: "http://xxxx:8000/sap/opu/odata/sap/Z188_PO_SRV/pos?$filter=Docdate le datetime'"
                    + todateformat+"T00:00:00' and Docdate ge datetime'"
                    + fromdateformat+"T00:00:00' and RelGrp eq '"
                    + relcode +"'and RelStr eq '"
                    + relstg +"'and Uname eq '"
                    + username+ "' "},
      function (data) {
    console.log(data);
    When we are giving correct inputs it will goes to Success function and get the data from back end.
    In console we can see the data.
    Hope this will helps to you.
    Thanks&Regards
    Sridevi

  • Changing fields based on database values

    Hi all,
    I have one form and two drop -down fields. The fields are Call Type and Sub Call Type and are on the SAME form. I pull data from the Call Type from the database. When the user selects a particular Call Type, I need to go back to the database and pull in values associated with that particular Call Type.
    This is the method, that I am using:-
    1) I first populate the Call Type drop down field by using a Server Side Method to fill in values for the Call Type and calling the database.
    2) I then call a method called as PopulateSubCallType by using the property On Change Invoke for the Call Type field.
    In this method I again call the database and based on the Call Type selected by the user, I pull in the associated Sub Call Types and store them in an array.
    3) I also call the same array to populate the Sub Call Types based on Call Types. But the drop down field for Sub Call Type is not auto-populated based on the values from the array. The array values although pulled up from the database are not shown on the form.
    Can you tell me a way to auto-populate the Sub Call Type from the database based on the Call Type selected by the user but on the SAME form.
    I AM NOT USING JSP's but ONLY ALBPM 6.0 PRESENTATIONS.

    refreshValidValues("someAttribute") is a method that comes with BPM Object presentations.
    This one line in this method will work because it causes the attribute (child in this case) to automatically invoke the method you created for retrieving the valid values of the children of the parent.
    Your server side method that dynamically returns valid values of the children based on the parent selected should be looking something like this:
    for each ...
    select * from child
    where parentOfChild = parentAttribute
    In this example the name of your parent attribute is "parentAttribute" column in the child database table that contains the parent's id is "parentOfChild".
    This causes the list of children to auto populate in the child combo dropdown automatically.
    To summarize - at runtime here is what happens:
    a) since the parent has a dynamic method that populates its valid values, as the presentation initializes the SQL for the valid values of the parent is run.
    b) the parent's combo dropdown is populated with a list of valid values of the parent
    c) the end user selects one of the parent's names from the combo dropdown
    d) this causes the method to fire that has only one line. This one line has the text "refreshValidValues("nameOfTheChildAttributeGoesHere")
    e) since the child has a dynamic method that populates its valid values, when the previous step caused this child attribute to refresh its valid values, the SQL in the method that dynamically retrieves the valid values of the child is run.
    f) the end user clicks the combo dropdown on the child's attribute and sees that the child valid values (based on the parent that was just selected) now appear.
    Dan

  • FR Change text value based on another member

    Hi,
    I using FR 11.1.1.3
    I'm trying to change the value of a data cell based on the value of the time dimension, so below is what I'm trying to do
    Change value to Quarter1 - 2012 if current point of view for time2 is Quarter1 and Current Year is 2012
    Change value to Quarter2 - Current Year if current point of view for time is Quarter2
    and so on
    Quarter1 and Current Year are coming from different dimensions.
    Please let me know if this is possible to do in FR
    I can easily do this in IR.
    Thanks

    Hi VS
    No problem it is always a bit open to interpretation when someone posts in these forums :-)
    So it sounds like you want to use Text based headings rather than data. Have you looked at the text functions rather than tring to do this with formulas. i think you might have more success using text rows and referencing the rows containing the member names, e.g. if you have two dimensions Period and Year (both in rows) then make use of the following function:
    Generic syntax:
    <<MemberName("GridName", Row/Col/Page, "DimName")>>
    Example:
    <<MemberName("Grid1)", 2, "Period")>> - <<MemberName("Grid1)", 2, "Year")>>
    should return the name of the member from the Period dimension from row 2 and the member of the Year dimension from row 2, e.g. Qtr1 - FY12
    There is a practically identical function MemberAlias too if it is the alias you want rather than the member name. Have a look in FR studio by inserting a text row / column and then trying to insert function. There are also 2 that you can use that are no longer show in FR studio or the studio user guide but do work (or at least did up until v11.1.1.x) and that is POVMember/POVName (can't remember now!) and POVAlias used to get the member/alias from the POV for a partcular dimension, syntax for that is:
    <<POVAlias("Grid1", "DimName")>>
    Hope this helps
    Stuart

  • Change column value based on another

    Hi, everyone.
    my version 11.1.2.2.0.
    i wanna change 1 column's value based on another column's value that be selected.
    ex: select 2rd column to 'A' , then the 1rd should be 'New Start'.
    i used EL like #{row.bindings.MacdType.inputValue eq 1 ? 'New Start' :  row.bindings.CircuitId.inputValue}.
    But it does not set the inputvalue which should binding with the DataSource.
    what's the best way to do these logic?
    pls help. thx

    Hi,Abhijit;
    ex: the frist column is a LOV, the user select "A" for the first column, so the value of the second column should be changed to 'New Start'.
    And the value should be binding to the DC, when save, the value of the 2rd column should be saved to DB.
    thx

  • Changing value in drop-down based on selected value in another drop-down

    Hi,
    I have two drop-downs - changing value in Combo1, should cause the form to be submitted and values to be populated in Combo 2.
    Approaches i tried - 1) I am using an ActionListener. I am having a valueChange method which accepts an action event. However this appraoch is not working for me. 2) I was wondering if I could use Javacsript to catch the OnChange event , the javascript function would call an appropirate method in my ActionListener. I know in Struts its straightforward, but how do i achive the same here in JSF.
    Any tips would be helpful.
    Thanks
    PS: I already came across some threads in the forum, but could not get an answer. Also, I have a retsriction in terms of using Action LIsteners itself.

    Try using ValueChangeListener instead of ActionListener.
    Here's a working example of a ValueChangeListener. You can customize it and use it for your application.
    The JSP will look like this:
         <h:selectOneMenu value="#{globalsBean.selectedFirst}"
              valueChangeListener="#{globalsBean.changeList}" onchange="submit()">
              <f:selectItems value="#{globalsBean.first}" />
         </h:selectOneMenu>
         <h:selectOneMenu value="#{globalsBean.selectedSecond}">
              <f:selectItems value="#{globalsBean.second}" />
         </h:selectOneMenu>The globalsBean will look like this:
    public class GlobalsBean extends Bean {
         ArrayList first;
         ArrayList second;
         String selectedFirst;
         String selectedSecond;
         public GlobalsBean() {
              first = new ArrayList();
              second = new ArrayList();
              first.add(new SelectItem("1", "1"));
              first.add(new SelectItem("2", "2"));
              selectedFirst = "1";
              selectedSecond = "";
              second.add(new SelectItem("White", "White Cows"));
              second.add(new SelectItem("Brown", "Brown Cows"));
              second.add(new SelectItem("Green", "Green Cows?!?"));
         public ArrayList getFirst() {
              return first;
         public ArrayList getSecond() {
              return second;
         public String getSelectedFirst() {
              return selectedFirst;
         public void setSelectedFirst(String selected) {
               selectedFirst = selected;
         public String getSelectedSecond() {
              return selectedSecond;
         public void setSelectedSecond(String selected) {
               selectedSecond = selected;
         public void changeList(ValueChangeEvent event) throws AbortProcessingException{
              second = new ArrayList();
              String newValue = (String)event.getNewValue();
              setSelectedFirst(newValue);
              if (newValue.equals("1")) {
                   second.add(new SelectItem("White", "White Cows"));
                   second.add(new SelectItem("Brown", "Brown Cows"));
                   second.add(new SelectItem("Green", "Green Cows?!?"));
              } else if (newValue.equals("2")) {
                   second.add(new SelectItem("White/Black", "White Cows with Black spots"));
                   second.add(new SelectItem("Black", "Black Cows"));
              setSelectedSecond("");
    }Let me know how it works out for you.
    CowKing

Maybe you are looking for