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.

Similar Messages

  • 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

  • Multiple Conclusion based on input values

    Hello,
    I think I have a similar request to this one: https://forums.oracle.com/message/9208952#9208952
    Basically I have a requirement to return a list of required documents someone must upload based on their application. The plan is to invoke the Determinations Server via the web service interface to get a list of the Documents (these would be URLs)  required based on some fields. I'm not quite sure how to approach the rules and web service call so that I would get a list of documents back. I want to complete it in Excel and would like the URL as the conclusion with the attributes as the entry fields.
    e.g. write rules like:
    the value of field1
    the value of field2
    document requiring upload
    X
    Y
    http://mysite.com/mydocument1.pdf
    X
    Z
    X
    Y
    http://mysite.com/mydocument2.pdf
    and when I invoke the determinations service with values X and Y the response would be something like:
    <typ:attribute id="document_to_upload" type="string" inferred="true">
         <typ:boolean-val>http://mysite.com/mydocument1.pdf</typ:boolean-val>
    </typ:attribute>
    <typ:attribute id="document_to_upload" type="string" inferred="true">
         <typ:boolean-val>http://mysite.com/mydocument2.pdf</typ:boolean-val>
    </typ:attribute>
    Can I do like above and how do I structure the rules and webservice calls to get a list of documents back? Or do I have to write a table of rules for each type of document and request an outcome/conclusion for each one to get the URL as the conclusion? Does one of the example projects that comes with the installation cover (or go close) a scenario like this?
    Thanks,
    Ross

    Thanks @ChaseVoid and @PaulFowler
    I have written up my rules and I have tested them in the debugger, all working as expected. Now I'm trying to get them via the web service and I can't seem to get the value back, only the instance. My request is as below:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/11.0/rulebase/assess/types">
       <soapenv:Header/>
       <soapenv:Body>
          <typ:assess-request>
             <typ:config>
             <typ:show-properties>true</typ:show-properties>
             </typ:config>
             <typ:global-instance>
                <typ:attribute id="bin_code">
                <typ:text-val>CHNY</typ:text-val>
       </typ:attribute>
       <typ:entity id="the_supplementary_documents" inferred="true">
                   <typ:instance id="x">
                    <typ:attribute id="supplementary_documents" outcome-style="value-only" />
                   </typ:instance>
                </typ:entity>
              </typ:global-instance>
          </typ:assess-request>
       </soapenv:Body>
    </soapenv:Envelope>
    The code given as an attribute input should return two supplementary documents and one informational document, which it looks like it finds but I'm not getting the value out of the instance. The response is below:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i18n="http://www.w3.org/2005/09/ws-i18n" xmlns:typ="http://oracle.com/determinations/server/11.0/rulebase/assess/types">
       <SOAP-ENV:Header>
          <i18n:international>
             <i18n:locale>en_GB</i18n:locale>
             <i18n:tz>GMT-0500</i18n:tz>
          </i18n:international>
       </SOAP-ENV:Header>
       <SOAP-ENV:Body>
          <typ:assess-response>
             <typ:global-instance>
                <typ:attribute id="bin_code" type="text">
                   <typ:text-val>CHNY</typ:text-val>
                </typ:attribute>
                <typ:entity id="the_supplementary_documents" inferred="true">
                   <typ:instance id="0x74d5b205a0612b60"></typ:instance>
                   <typ:instance id="0x9163835e55979771"></typ:instance>
                </typ:entity>
                <typ:entity id="the_informational_documents" inferred="true">
                   <typ:instance id="0xc8730b5ed088cbce"></typ:instance>
                </typ:entity>
             </typ:global-instance>
          </typ:assess-response>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I'm sure it's a matter of passing a new element or adding an attribute to an element there but I can't work out which one. Any ideas?
    Thanks

  • Condition based on Input value by parameter

    Hi experts,
    I  am looking for a solution in crystal reports  in conjustion to BI . I m using Bex query directly for this report rathing creating an universe.
    I am trying to create a RKF based on parameter value by user's input.
    For example : - user input a date FROM-TO and than I am filtering minimum and maximum value . Based on these 2 values I have to restrict a KF Sales amount.
    Whenever I try to do like this in formula I get this error. Can someone help me in that please ?
    if  ({ZCRETA_ZZCRETA_Q_001_TEST.[ZCALMTH]} <= {@Min}) then {ZCRETA_ZZCRETA_Q_001_TEST.[Measures]-[D6T7LZ8YG3KSRHCE821ZX1WVY]}
    I also tried while do as well but did not work.Bascially I am trying to do something like this
    If Calmonth <= Min ( already filtered by me from parameter's value ) than display sales amount.
    As per this logic I should be able to see all the sales amount wherver Calmonth is less than of equal to minimum value of Calmonth.
    Thanks in Advance,

    Hi, your statement is looking at a formula, not a parameter
    f ({ZCRETA_ZZCRETA_Q_001_TEST.ZCALMTH} <= {@Min}) then {ZCRETA_ZZCRETA_Q_001_TEST.Measures-D6T7LZ8YG3KSRHCE821ZX1WVY}
    If it was a parameter it should look like this
    if ({ZCRETA_ZZCRETA_Q_001_TEST.ZCALMTH} <= {?Min}) then {ZCRETA_ZZCRETA_Q_001_TEST.Measures-D6T7LZ8YG3KSRHCE821ZX1WVY}
    you may also need to add the else.

  • Dynamic table rows created based on input value

    I've been searching the forum for either a tutorial or input
    on how to create a table where the number of rows are based on a
    user input value. I can't seem to find anything on this.
    Here's what I'm trying to do. I have site where people are
    charged based on the number of items they register. So if they want
    to register 2 items. They would input the number 2 for quanity and
    I would display a dynamic table with 2 rows. The user will input
    their data for the 2 items and I insert this into an
    itemsRegistered table. If they entered 4 I would give them 4 rows
    for input. I am using dreamweaver with PHP and MySql database. Can
    anyone point me in the right direction. Any help would be
    appreciated!

    Not exactly. The items are all the same but have a different
    registration number (like a serial number). So if the user wants to
    register 2 items. They would input the number 2 on the form. Then 2
    rows would appear on the table, one for each registration number.
    When they finish entering the data it would be inserted into the
    database as 2 records.
    So for example if item 1 has registration number 10000 and
    item 2 has registration number 11000. The registration numbers are
    unique. The table would look like this :
    CustomerID (links to customer table)
    RegistrationID (Unique in this table)
    ItemColor
    ItemShape
    I don't know if I've explained this well but thanks for even
    attempting to answer this! I really appreciate it!

  • Change value of another field based on the value of selectOneRadio

    Hello
    I need to display one of two city fields based on the value of a radio group. If the value of the radio group is "Yes", then display the non mandatory city field, if the value is "No", then display mandatory city field. Please can someone help me? The code is below
    <af:subform id="contactForm3" default="true">
                <af:panelForm binding="#{processScope.backing_regDetails.contactPanel3}">
                  <af:selectOneRadio binding="#{processScope.backing_regDetails.radio1}"
                                     labelAndAccessKey="#{MatrixResource['ContactDetails.inBoroughQuestion']}"
                                     layout="horizontal"
                                     valuePassThru="true"
                                     required="true"
                                     onchange="javascript.refresh;" >
                      <f:selectItems value="#{processScope.backing_regDetails.items}" />
                  </af:selectOneRadio>
                  <af:inputText onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.SAO']}"
                                binding="#{processScope.backing_regDetails.houseNameText}"                           
                                maximumLength="240"/>
                  <af:inputText required="true"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                maximumLength="240"
                                label="#{MatrixCommon['Label.PAO']}"
                                binding="#{processScope.backing_regDetails.numberStreetText}"/>
                  <af:inputText onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                maximumLength="240"
                                labelAndAccessKey="#{MatrixCommon['Label.District']}"
                                binding="#{processScope.backing_regDetails.districtText}"/>
                  <af:inputText maximumLength="60"
                                rendered="#{!backing_regDetails.radio1}"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.TownCity']}"
                                required="true"
                                binding="#{processScope.backing_regDetails.cityText}"/>
                 <af:inputText maximumLength="60"
                                rendered="#{backing_regDetails.radio1}"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.TownCity']}"
                                required="false"
                                binding="#{processScope.backing_regDetails.cityText}"/>
                  <af:inputText maximumLength="60"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.County']}"
                                binding="#{processScope.backing_regDetails.countyText}"/>
                  <af:inputText columns="7"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                labelAndAccessKey="#{MatrixCommon['Label.Postcode']}"
                                binding="#{processScope.backing_regDetails.postcodeText}"/>
                  <af:selectOneChoice onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                      binding="#{processScope.backing_regDetails.countrySelect}"
                                      value="#{processScope.backing_regDetails.enteredAddress.countryId}"
                                      labelAndAccessKey="#{MatrixCommon['Label.Country']}">
                      <f:selectItems value="#{backing_regComponents.countryChoiceList}"/>
                  </af:selectOneChoice>
                  <af:inputHidden value="#{processScope.backing_regDetails.enteredAddress.locationId}"
                                binding="#{processScope.backing_regDetails.locationIdHidden}"
                                id="locationId"/>
                  </af:panelForm>
                  </af:subform>Edited by: aademola on Nov 13, 2008 7:35 AM
    Edited by: aademola on Nov 13, 2008 7:42 AM

    Hi,
    you should be able to apply this example to your 10.1.3 project
    see 4.3.2 of http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_lifecycle.htm#CIAHCFJF
    Frank

  • Flagging a variant by a feild value based on char,value.

    Hello SAP Gurus,
    I have a requirement in which I have to flag a variant based on characteristic values.
    During configuration, when you happen to select certain characteristic values in  a character, the material should flag with a character material master field, which changes the way the material is handled.
    Any feed backs...
    I am thinking of creating another character with the material master field and establishing an "object dependency" between characteristic values and character....
    Is this correct?
    Thanks
    Eshlok

    It seems that don't understand that you aren't asking to Apple employees but to end users like you.
    May you take time to download iWork Formulas and Functions User Guide (thru the Help menu) ?
    I will not spend time describing Nummbers functions one after an other one !
    I am unable to guess what you tried to achieve with your formula..
    To calculate 33% of the content of c6, use the formula
    =ROUNDUP(C6*.33,0)
    or
    =ROUNDUP(C6/3,0)
    Yvan KOENIG (VALLAURIS, France) lundi 27 juin 2011 18:14:03 iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How to select a different value based on $FLEX$ Value set

    Hi friends,
    am getting a column like position from positions_table....
    now based on this value set am selecting another column from the same table like for ex amount...using $FLEX$.vlaueset_name
    now if the value in the table is 0 or null I should make the field available for the user to enter something
    as of now it is not letting me enter any data as this value is based on the first value set we defined..
    is there a way to do that..
    hope am clear in specifying my requirement
    thanks

    Hi Balraj
    I want to select one list item value from yyy based on the xxx item value..Pls use the following andreas's link ( it's about it)
    http://andreas.weiden.orcl.over-blog.de/article-28957008.html
    pls study it carefully and develop.
    Hope it helps...
    Regards,
    Abdetu...

  • Select value based on a value in a 2nd column (similar to vlookup)

    Hello all,
    Is there an alternative to VLOOKUP function in BI 11g?
    Or what else I can use to return value of 3rd column based on the value in 2nd column?
    Dept Min_Expense Description of Expense
    Acct 1000 'COGS'
    Thank you.

    Hi,
    Yes this is possible by dynamic user assignment.
    Define an output parameter for CO1 and CO2 and an input parameter for the CO under action F of type string. In design time select the processor of action F as "Filled from Context Parameter" in the Roles tab and select the input parameter you have defined as mentioned in the previous step. Now group the output parameter of the CO1 and CO2 and the input parameter of action F together.
    Now at runtime fill the context parameter from CO1 and CO2 with the actual user name. The action F will get automatically assigned to that user.
    Thanks,
    Dipankar

  • Query on DSO, KF value +/- based on flag value in DSO

    Hi Experts,
    I have a query on DSO and it is running fine.
    Current Query output :
    CHAR1 | CHAR2 | KF1
    1111       S            100
    1111       H            100
    I want to put + or - sign for KF based on value of CHAR 2 (Flag) in query output.
    So
    Desired Query output :
    CHAR1 | CHAR2 | KF1
    1111       S            -100
    1111       H             100
    I can Add CHAR3 in DSO and based on CHAR2 value CHAR3 will store +1 or -1. Add it can be used to get + or -Value of KF using CKF.
    But without doing it (CHAR3), can I do it directly at query level ?
    Regards,
    Vinod

    Try this:
    RKF1: KF restricted on S
    RKF2: KF restricted on H
    CKF: (-1)*RKF1 + RKF2
    This should give you what you are looking for.
    Regards,
    Gaurav

  • Dynamic variable value based on a value from xml

    I have a invoice template and it is for 4 different companies in my organization. Based on the organization I need to have a different value for a variable that adds blank lines to the end of the invoice. Is there anyway to assign a value to variable based on the value of a xml tag.
    Thanks

    I should have explained better before. I have one invoice template and we want to keep it one template for all companies. Each invoice is run individually, each companies footer is different, I am calling multiple headers and footers based on each company. Since the headers and footers are different I need to be able to add different amounts of lines and the end of each invoice depending on that company. I have accounted for the page break in my logic based on the amount lines the page is long. I just need a dynamic variable that I can assign different values on the fly.
    Thanks

  • Getting Value Based on Descending value of the count

    Hi,
    I have values in the list as below
    Title,Count
    title1,3
    title2,5
    title3,4
    Now i need to fetch the title column value based on descending order of the count column value.
    But writing spquery as below but not getting the exact value
    "<OrderBy><FieldRef Name='Count' Ascending='FALSE' /></OrderBy>";
    Please let me know if i am making any mistake here.
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi,
    In addition to Hemendra, there is OOB option to order items in descending order per one column value.
    You could create a view for this list, and configure in Sort section.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Populate field1 in table, based on dropdown value of a field2 in same row

    Hi Experts,
    I have created an offline interactive Adobe form and need help with java-script on events. I will describe my scenario below -
    I have written an SE38 report program which will generate the PDF. To pre-populate fields in the PDF, I have a structure Default_Values which has a few internal tables. One of the internal tables Employees has 2 fields Emp_Code and Emp_Name. I have written code to obtain a list of employees and populate this internal table Empoyees. I call the Adobe form and along with other parameters, pass this structure Default_Values. Thus all the default values along with the internal table Employees pre-populated with the Employee Code and Employee Names have been passed to the Context.
    In the Adobe form I have a table with 10 lines with Employee details (6 columns, 2 of which are Emp_Code and Emp_Name)
    In this table control, the column Employee Name is a drop down list. For this column, under List Items, I have created a binding to the internal table Employees with default values. This binding Items looks like this - $record.DEFAULT_VALUES.EMPLOYEES.DATA[*] with Item Text and Item Value having the value EMP_NAME.
    When I test the form, I can see all the Employee Names in the drop down list in the column Employee Name of the table control.
    My requirement is that when a user selects an Employee Name from the drop-down list, the field Emp_Code for that row in the table control should be automatically populated with the corresponding value of Emp_Code  depending on the Emp_Name which the user has selected.
    I am new to Java-scripts and Adobe forms. I have searched this and other forums, however I couldn't find the right code which I can place in either the Change or Exit event of the drop-down to accomplish this.
    Can someone please provide me with sample code to achieve this.
    Any help will be greatly appreciated.
    Thanks in advance.
    Regards,
    Neha

    Hi Neha,
    I would prefer not to use FormCalc for this requirement.
    Array Processing shall be done in Java Scripting and you simply cannot have two different scripting language elements in the same scripting block.
    First create a table type parameter in the interface or GT_* type in Global variable and pass all the necessary entries of dropdown to the table type parameter. Once included in the context it shall be available in your data view of the form.
    To access any repeating instance node of the form in the data view, use te following script -
    var theFields = xfa.resolveNodes(
                      "xfa.datasets.data.data.CUSTOMERS.DATA[*].NAME");
    assuming that you have a table named CUSTOMERS in the Data View.
    For more details on XFA Data Model refer to
    [http://help.adobe.com/en_US/livecycle/es/lcdesigner_scripting_reference.pdf]
    Hope these inputs help.
    Regards,
    Rohit

  • How do I populate one Combo box based on input from another

    Hi,
    I have a dynamic Combo box populated from a database. Now I want to use the onChanged event to dynamically populate a second combo box on the same page.
    Any ideas on how to do this?
    Robert
    [email protected]

    Here is an example:
    let us consider it not coming from the database:
    <html>
    <head>
    <title>New Page 1</title>
    <script>
    function popSub()
    var n = 1;
    var mainValue;
    mainValue = document.test.main.options[document.test.main.selectedIndex].value ;
    if (mainValue=="Age" )
                        document.test.sub.options[n].value = 'below18';
                        document.test.sub.options[n].text = 'Below 18';
                        n =     n + 1;
    if (mainValue=="Age" )
                        document.test.sub.options[n].value = 'over18';
                        document.test.sub.options[n].text = 'Over 18';
                        n =     n + 1;
    if (mainValue=="Sex" )
                        document.test.sub.options[n].value = 'male';
                        document.test.sub.options[n].text = 'Male';
                        n =     n + 1;
    if (mainValue=="Sex" )
                        document.test.sub.options[n].value = 'female';
                        document.test.sub.options[n].text = 'Female';
                        n =     n + 1;
    </script>
    </head>
    <body>
    <form method="POST" name="test">
    <p><select size="1" name="main" onClick="popSub()">
    <option value="Age">Age</option>
    <option value="Sex">Sex</option>
    <option selected>select one</option>
    </select></p>
    <p><select size="1" name="sub">
    <option value=""></option>
    <option value=""></option>
    <option value=""></option>
    </select></p>
    <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    </body>
    </html>
    If it coming from the database then you have to write the javascript function in jsp as follows:
    out.println('<script language="JavaScript">');
    out.println('function popSub()');
    out.println('{');
    out.println('var n = 1;');
    out.println('var mainValue;');
    out.println('mainValue = document.test.main.options[document.test.main.selectedIndex].value ;');
    // start one for loop from 1 to record count
    out.println('if (mainValue=="' + valuefrom the resultset + '")');
    out.println('{');
    out.println("document.test.sub.options[n].value = '" + value from the result set +"';");
    out.println("document.test.sub.options[n].text = '"+value from the result set+"';");
    out.println('n=n+1;');
    out.println('}');
    // end of the for loop
    finish the javascript function using out.println

  • Changing field text color and fill based on input value.

    I am trying to create a field that can be red, yellow or green.  In the end, what I need is a box that can be made red, yellow or green by the form user.  My strategy is to use a validation script to change the field and text color based on the field input.  So if you type "red", the text and field turn red, essentially making a red box.  The field is named "GoalColor".
    Am I headed in the right direction to get make this dynamic colored box?
    This script works but you must type "red" into the field(including quotation marks).  Any ideas on why the word red alone isn't triggering it? 
    var vcolor = this.getField("GoalColor").value;
    if (vcolor == "red") {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    I have also tried - works if you type 'red'
    var vcolor = this.getField("GoalColor").value;
    if (vcolor == 'red') {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    and  - does not work
    var vcolor = this.getField("GoalColor").value;
    if ( vcolor == red ) {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    Thanks!

    And you don't need to add the quotation marks in the text field. In fact, doing it will cause the script not to identify the word.

Maybe you are looking for