Get Value From an input field

Hi All,
I am a newbie to ABAP Webdynpro.I would liketo know how should I get the value from an input field at runtime?
Thanks,Mukta

By reading the context attribute which bound to inputfield, you can get the value.
Say you have a node called 'MAIN_NODE' and has the attribute 'INPUT_VALUE', which is bound to the Inputfield.
  DATA LO_ND_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
  DATA LO_EL_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
  DATA LS_MAIN_NODE TYPE WD_THIS->ELEMENT_MAIN_NODE.
  DATA LV_INP_VALUE LIKE LS_MAIN_NODE-INP_VALUE.
* navigate from <CONTEXT> to <MAIN_NODE> via lead selection
  LO_ND_MAIN_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = 'MAIN_NODE' ).
* get element via lead selection
  LO_EL_MAIN_NODE = LO_ND_MAIN_NODE->GET_ELEMENT(  ).
* get single attribute
  LO_EL_MAIN_NODE->GET_ATTRIBUTE(
    EXPORTING
      NAME =  `INPUT_VALUE`
    IMPORTING
      VALUE = LV_INP_VALUE ).  "LV_INP_VALUE will have the value of inputfield
Raja T
Message was edited by:
        Raja Thangamani

Similar Messages

  • Capture value from the input field

    Hello All,
            I'm new to BSP.
    I have a small querry.
    I have a input field.
    beside this a push button.
    if i enter a value in the input field and press the push button, i need to capture the value from the input field and pass it to a variable contained in a class.
    i'm attaching the layout code here.
    but i'm not knowing what to write in the event(on input processing)
    <u><b>Layout code &#61664;</b></u>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title        = "Page to take the value from the screen and pass to the class "
                  marginBottom = "100"
                  marginLeft   = "250"
                  marginRight  = "100"
                  marginTop    = "100"
                  scrolling    = " AUTO" >
        <htmlb:form>
          <htmlb:tray id        = "tray1"
                      hasMargin = "TRUE"
                      title     = "Value Capture"
                      width     = "350" >
            <htmlb:textView text      = "Enter a value"
                            design    = "emphasized"
                            textColor = "negative" >
            </htmlb:textView>
            <br>
            <htmlb:inputField alignment = "left"
                              id        = "gv_var"
                              required  = "true"
                              type      = "STRING"
                              design    = "standard" />
            <htmlb:button design  = "emphasized"
                          id      = "button"
                          text    = "SUBMIT"
                          onClick = "btn_click" />
            </br>
          </htmlb:tray>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    eventhandler&#61664;on input processing code
    DATA: event TYPE REF TO if_htmlb_data.
    event = CL_HTMLB_MANAGER=>get_event_ex( request ).
    IF event->EVENT_NAME = 'button' AND event->EVENT_TYPE = 'click'.
        ENDIF.

    HI BSPian,
        htmlb:inputField value = "<%= v_value %>"
                         id = "gv_var"
                         required = "true"
                         size = "10"
                         type = "STRING"
                         maxlength = "10"
                         design = "standard" />
    Here u mean to say that v_value must be one more field type string. is it so ?
    But i want to see the value in the same input field
    id ="gv_var". i.e if i enter the value "BSPian" in the input field and press "submit" the internal processing will be done as told by u and after that ,on the screen i want to keep that value till i end that session.
    i passed a variable v_value in the inputfield value but it's not working ..
    regards,
    deepu.

  • How to get the value from the Input field of the Table view.

    Hi Experts,
    I have created a table view with 10 rows and each rows contains input fields in it.Can you please help me getting the values that are entered in all 10 rows.
    Currently I am using the below code,but using the below I am able to get only the first row details of the table.
      lo_el_table->get_static_attributes(
        IMPORTING
          static_attributes = ls_table).
    Please let me know you suggestions on this.Thanks in advance.
    Regards,
    Arun

    Hi Arun,
    You should use this method:
    lo_nd_table->get_static_attributes_table(
    IMPORTING
    table = lt_table).
    Cheers,
    Roelof
    http://www.nl4b.com

  • How to get the values from the input field of a table

    Hello Friends
    I am having table having one column as InputField and rest are the textview fields
    I input the data and click the button that will add them to a node.
    But what is happening is it is adding the current value to all the fields replacing other filelds.
    Like suppose I am having 3 rows
    In column I input 10
    In column 2 input 20
    In column 3 input 30
    Now it is setting the value 30 to all the 3 fields.
    Can any one tell me the code to set 10, 20 and 30 as different value in a node as entered by me.
    Thanks

    Hi
    i am your scernario as follows
    Context
    TN_node (value node of cardinality 0:N)
                 val1 (value attribute under value node)
                 val2 (value attribute under value node)          
    i have binded Tn_node to table and val1 is textview and val2 is inputfield
    public void wdDoInit()
        //@@begin wdDoInit()
        for(int i=0;i<5;i++)
        IPrivateTestView.ITN_nodeElement ele=wdContext.nodeTN_node().createTN_nodeElement();
        wdContext.nodeTN_node().addElement(ele);
        ele.setVa1("val"+i);
        //@@end
    i have a button go in which printing all the values
    public void onActionGo(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionGo(ServerEvent)
        for(int j=0;j<wdContext.nodeTN_node().size();j++)
        //IPrivateTestView.ITN_nodeElement
        IPrivateTestView.ITN_nodeElement ele=wdContext.nodeTN_node().getTN_nodeElementAt(j);
    wdComponentAPI.getMessageManager().reportSuccess("-----"+ele.getVa1());
    wdComponentAPI.getMessageManager().reportSuccess("-----"+ele.getVa2());
    Hope this helps,
    If your problem is not solved please post your code like this
    Thanks and Regards,
    Arun

  • How to get values from dynamically populated field symbol

    Hi all,
    I am having a field symbol <fs_table> type standard table, which is getting populated dynamically.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = i_fieldcat[]
        IMPORTING
          ep_table        = is_eptab.
      ASSIGN is_eptab->* TO <fs_table> .
    After the ALV display i am making some changes in the ALV and getting a new internal table <fst_table>,which is having changed values.
    Now the problem is that i am not able to get the changed values from <fst_table>  as it is not of any structure type and cant associate it with any field like we do in normal internal table and work areas like, wa-fieldname.
    All the fields are dynamic.
    Regards,
    Anant

    Hello Anant
    You have to access to access the fields of your dynamic outtab dynamically as well.
    DATA: ls_fcat   TYPE lvc_s_fcat.
    FIELD-SYMBOLS:
      <ls_struc>   TYPE any,
      <ld_fld>       TYPE any.
    LOOP AT <fs_table> ASSIGNING <ls_struc>.
      LOOP AT i_fieldcat INTO ls_fcat.
        ASSIGN COMPONENT ls_fcat-fieldname OF STRUCTURE <ls_struc> TO <ld_fld>.
        ...  " do processing
      ENDLOOP.
    ENDLOOP.
    Regards
      Uwe

  • Need help to get the user entered value from a input field in Table in OA

    I have a table in my OA page.
    Here one column is there which should take in put from user.
    i.e an item quantity field text input is there which should take the updated value when the add to cart link which is next column in the table. On clicking of the link I am trying to get the updated value entered by user. for the respected row for which addto cart link get clicked.
    For that link I have defined some parameter through SPEL,( like this parameter name: item_quantity value : ${oa.MisibeItemSearchVO.ItemQuantity} ) which has fireaction. But when i am clicking the addto cart link I am not getting the current value entered by the user.
    Can any body guide me how to get that related value for which the add to cart link got clicked.
    for this when i am doing pageContext.getParameter("item_quantity"));
    I am not getting the value entered by user.
    please suggest me
    Thanks!
    Smarajeet

    The below is my Vo query for item quanity i am using a dummy query "(select null from dual) as ITEM_QUANTITY"
    in the below query and item type is number. and this is a messageTextINput in OA page and is maped to ItemQuantity vo attribute.
    SELECT idsi.section_item_id
    ,idsi.inventory_item_id
    ,(select concatenated_segments from mtl_system_items_kfv mstk
    where mstk.inventory_item_id = idsi.inventory_item_id
    and mstk.organization_id =idsi.organization_id) ITEM_NAME
    ,(select description from mtl_system_items_tl mtll
    where mtll.inventory_item_id = idsi.inventory_item_id
    and mtll.organization_id =idsi.organization_id
    and language = USERENV('LANG') ) ITEM_Description
    ,(SELECT CASE
    WHEN instr(msib.segment6,'NAMED USER') > 0 THEN 'NAMED_USER'
    WHEN instr(msib.segment6,'PROCESSOR')>0 THEN 'PROCESSOR'
    ELSE msib.segment6
    END
    FROM MTL_SYSTEM_ITEMS_B msib
    WHERE msib.INVENTORY_ITEM_ID = idsi.inventory_item_id
    AND msib.ORGANIZATION_ID = idsi.organization_id) LICENSE_TYPE
    ,(SELECT CASE
    WHEN instr(msib.segment6,'1 YR') > 0 THEN '1YR'
    WHEN instr(msib.segment6,'2 YR') > 0 THEN '2YR'
    WHEN instr(msib.segment6,'3 YR') > 0 THEN '3YR'
    WHEN instr(msib.segment6,'4 YR') > 0 THEN '4YR'
    WHEN instr(msib.segment6,'5 YR') > 0 THEN '5YR'
    WHEN instr(msib.DESCRIPTION,'Perpetual') > 0 THEN 'PERPETUAL'
    END TERM FROM MTL_SYSTEM_ITEMS_B msib
    WHERE msib.INVENTORY_ITEM_ID = idsi.inventory_item_id
    AND msib.ORGANIZATION_ID = idsi.organization_id) TERM
    ,(select qll.operand
    FROM qp_list_lines qll
    ,qp_pricing_attributes qpa
    WHERE qll.list_line_id = qpa.list_line_id
    AND qpa.product_attr_value = to_char(idsi.inventory_item_id)
    AND qll.list_header_id = 439381
    AND sysdate between NVL(qll.start_date_active, sysdate) and NVL(qll.end_date_active, sysdate+1)
    AND qpa.list_header_id = qll.list_header_id
    AND qpa.product_attribute = 'PRICING_ATTRIBUTE1'
    AND qpa.product_attribute_context = 'ITEM'
    AND NVL(qpa.pricing_attribute_context,'MIXED') = 'MIXED') ITEM_PRICE
    ,(select null from dual) as ITEM_QUANTITY
    ,(select currency_code from qp_list_headers_b where list_header_id =439381) currency_code
    ,(select segment1 from mtl_system_items_b msib
    where msib.inventory_item_id = idsi.inventory_item_id
    and msib.organization_id =idsi.organization_id) PART_NUMBER
    FROM ibe_dsp_section_items idsi
    ,ibe_dsp_msite_sct_items idmsi
    ,( select distinct child_section_id
    from IBE_DSP_MSITE_SCT_SECTS b
    connect by PRIOR child_section_id = parent_section_id
    start with parent_section_id =:1
    and mini_site_id =1
    UNION
    select distinct child_section_id
    from IBE_DSP_MSITE_SCT_SECTS b
    where child_section_id =:1
    and mini_site_id =1
    ) csi
    WHERE idsi.organization_id = 101
    AND idmsi.section_item_id = idsi.section_item_id
    AND idsi.section_id = csi.child_section_id
    AND idmsi.mini_site_id = 14409

  • Issue in getting value from c.Input component

    Hi Widget experts,
    I'm creating an enterprisre widget and one of the components used is c.Input type.
    I could set the values of the component using setValue() method. In runtime if the value in the component c.Input is changed and try to retrieve the value using getValue(), it is not returning the runtime updated value but instead giving the value that is set prior.
    Providing example:
    var x = 'ABCD';
    components.cMainInput.setValue(x);
    (In another method... trying to retrieve the changed value say WXYZ, of the input)
    var x = components.cMainInput.getValue();
    Expected that the value in x now should be WXYZ but instead I'm receiving it as 'ABCD'.
    Can any of you, provide solution for this issue?
    Thanks & Regards,
    Syamala

    I could figure out solution. Its mandatory to use validate() function before using getValue().
    Validate function makes the the runtime value available to retrieve after successful execution.
    Thank you for the viewers.

  • Get value from input text in read only adf table

    all,
    i added a column to an adf read-only table and inserted an input text control in the extra column. how do i loop through the table to get the value from the input field?
    paul

    Hi,
    can you be more clear on the usecase? Its a read only table that you added a input text field in a new column. What is the column based on and what is the goal of looping through ?
    Frank

  • How to get the vlaue from an input field without hitting the enter button ?

    Hello All,
      Is there some way to read the values of an input field that was filled in by an user eg ..
    String userEntry = wdContect.<UIElement>.value;
      So far, I am only able to achieve this using the onEnter property whoch really is not very user friendly since I can only read in the values only if the user hits enter.
      Any help will be appreciated.  Thank you.
    from
    Kwok Wei

    1. Create a value attribute (MyText) in the controller context
    2. Create a value attribute (MyText) in the view context
    3. Map view context attribute to controller context attribute
    4. Create InputField in the view and map the "value" attribute to the MyText view context attribute
    5. Create Action on view (Send)
    6. Create Send button and specify Send action as onAction attribute
    7. Create executeSend() method on controller
    8. onActionSend() implementation:
      public void onActionSend(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSend(ServerEvent)
       wdThis.wdGet<controllername>Controller().executeSend();
        //@@end
    9. executeSend() implementation:
      public void executeSend( )
        //@@begin executeSend()
                   // Get MyText
                   String MyText = wdContext.currentContextElement().getMyText();

  • Compound date (dd.MM.yyyy HH:mm) from two input fields

    Hi,
    I need to compound a date field in format dd.MM.yyyy HH:mm from two input fields(date and time field). I was trying a lot but could not get it to work. So right now I'm trying to start it simple but still have a couple of problems.
    1.) To start easy I wanted to fill a hardcoded date into my field.
    setAttribute(MYDATE, "01.01.2005 12:10");
    brings (java.lang.IllegalArgumentException) Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
    2.) setAttributeInternal(MYDATE, "01.01.2005 12:10");
    brings JBO-27018: AttrSetValException Cause: The type of attribute value provided as an argument to the set() method for this attribute is not an instance of the Java type that this attribute expects.
    3.) The thing that I reall need is something like:
    DateFormat sim = new SimpleDateFormat("dd.MM.yyyy HH:mm");
    java.util.Date datum = new java.util.Date();
    try
    datum = sim.parse("01.01.2005 12:30");
    } catch (ParseException e)
    setAttributeInternal(MYDATE, datum);
    but right now this also ends with the JBO-27018
    I also did try different types (timestamp and date) in my entity object and different format masks. Not working at all. All the threads I found are pointing to articles from Steve, which are not available anymore (the links don't work). So any help is appreciated.
    Regards, Peter

    Thankyou for the hint. I get it to work with
    public void whatever
    DateFormat simple = new SimpleDateFormat("dd.MM.yyyy HH:mm");
    java.util.Date javaDate = new java.util.Date();
    try
    javaDate = simple.parse("01.01.2005 12:30");
    } catch (ParseException e)
    java.sql.Timestamp sqlDate = new java.sql.Timestamp(javaDate.getTime());
    oracle.jbo.domain.Date nowDate = new oracle.jbo.domain.Date(sqlDate);
    setAttributeInternal(MYDATE, nowDate);
    but is there an easier and more 'beautiful' way to do this? Like using a date formatter on oracle.jbo.domain.Date instead using the SimpleDateFormat? btw. did I mention that I'm a Forms and PL/SQL programmer ;-)
    Regards, Peter

  • How to get value from one context node to otehr contect conde in diff views

    Hello Guru's
    We have a rek which is of getting the value from one context node to other context node,
    for example there is Total value in BT111H_OPPT/ITEMLIST (One context node) we need to have the same Total value in the in BT111H_OPPT/DETAILS (other context node) automatically
    Inputs are highly appricated.......

    Hello,
    Thanks for your Reply
    But my rek is i want to get value from different views
    eg BT111H_oppt/itemslist(contex node - BTADMINI) field net value to BT111h_opp/Details(Context node - BTopporth)
    for this which method should i use to chive this.
    Thanks..

  • How can I get values from listbox?

    Hi all,
    I need to get price values from Price List (Inventory -> Item Master Data screen). It's important to get values from field 'Price' BEFORE item will be added/updated.
    How can I get values from Pricelist listbox?
    Thanks for any suggestions or short sample code.
    Best regards,
    Andy

    Hi Andy
    Here is som sample code that will get the description of the price list and also the price that is displaying at the time. The item master must be open for this snippet of code
      Public Sub GetItemPriceFromOpenWindow()
            'this is assuming item master is open
            Dim oEdit As SAPbouiCOM.EditText
            oEdit = SBO_Application.Forms.GetForm("150", 1).Items.Item("34").Specific
            SBO_Application.MessageBox(oEdit.Value)
            Dim oCmb As SAPbouiCOM.ComboBox
            oCmb = SBO_Application.Forms.GetForm("150", 1).Items.Item("24").Specific
            SBO_Application.MessageBox(oCmb.Selected.Description)
        End Sub
    Hope it helps

  • Get values from dynamic form items

    Hi All,
    I create a dynamic form with text input component
    private function buildForm():void{
                    var numberOfColumns:Number = 5
                    var formItem:FormItem = new FormItem();
                    var hBox:HBox = new HBox();
                    for(var i:Number=0; i< numberOfColumns; i++) {
                        var formInput:TextInput = new TextInput();
                        formInput.text = "test";
                        formInput.id = "txt_" +i;
                        hBox.addChild(formInput);
                    formItem.addChild(hBox);
                    loansForm.addChild(formItem);
    I can see the text input components, update the values.
    How can I get the updated values from the input components?
    I try  this["txt_" + i].text  but not working. It's not finding the component with the dynamic value.
    Any ideas?
    Thanks
    Johnny

    Hi,
    Here is the related thread, u will get some help
      http://forums.adobe.com/message/3075226
    Thanks and Regards,
    Kanchan Ladwani | [email protected] | www.infocepts.com

  • JSF:how to get value from dinamically generated HtmlInputText components�H�H

    <h:panelGroup binding="#{dynamicInputGroupBean.group}"/>
    public HtmlPanelGroup getGroup() {
              if (this.getSelectedComp() == null) {
                   return this.group;
              FacesContext facesContext = FacesContext.getCurrentInstance();
              Application application = facesContext.getApplication();
              this.group = new HtmlPanelGroup();
              Set pSet = this.getSelectedComp().getParameterses();
              int size = pSet.size();
              this.instanceValue = new String[size];
              int i = 0;
              for (Iterator it = pSet.iterator(); it.hasNext();) {
                   Parameters tempP = (Parameters) it.next();
                   HtmlOutputLabel outputLable = new HtmlOutputLabel();
                   HtmlInputText inputText = new HtmlInputText();
                   inputText.setId("p" + i);
                   String valueBindingExpression = "#{dynamicInputGroupBean.instanceValue["+i+ "]}";
                   System.out.println(valueBindingExpression);
                   ValueBinding valueBinding = application
                             .createValueBinding(valueBindingExpression);
                   inputText.setValueBinding("value", valueBinding);
                   outputLable.setFor(inputText.getId());
                   outputLable.setValue(tempP.getParaname() + ": ");
                   group.getChildren().add(outputLable);
                   group.getChildren().add(inputText);
                   i++;
              // group.getChildren().add(new HtmlInputText());
              return group;
         }as codes show above, i successfully genera HtmlInputText dinamicaly�C
    but i got problems while i try to print those values...
    after the the jsp page presents in my browser,
    i input some words in the input components,
    and then click a commandButton hold an action to print their value
    action code :
    String[] tempArray = this.getInstanceValue();
    for (int i = 0; i < tempArray.length; i++) {
    System.out.println(tempArray);
    only NULL has been printed in the consol ....not the word i inputed!!!
    so my question is how can i get values from those
    dinamically generated HtmlInputText ????

    This approach is odd. What's the functional requirement after all? You normally attach the inputtext value to a backing bean property and do the desired command button action which is attached to a backing bean action method. In this method you then use the value for the query.

  • How to get values from an IFrame...

    Hi everyone. I have come to a complete stop i my project and need to ask the following: How do i get the values from an IFrame.
    Situation: I have a main.jsp page that contains an IFrame(data.jsp). Data.jsp is basically made up of a bunch of checkboxes. The state of these boxes(checked or unchecked) is determined and set by a JAVA program and the results are then stored in a StringBuffer. Contents of Stringbuffer could look something like this: <tr><input type='checkbox' name='box0' CHECKED></tr>.
    The StringBuffer in then presented in the IFrame(data.jsp) like so: <%=res.getInfo()%>
    The user should be able to check or uncheck the boxes from the main.jsp page then when pressing a submit button the changes should be stored in a DBase.
    After the submit button have been pressed i go into my Servlet's doPost() method for some basic processing. This is were the problem starts. I usally use HttpServletRequest.getParameter(String param) to get values from the main.jsp page. But these checkboxes are stored in the IFrame, so how do i go about to retrieve the values from data.jsp from the doPost() method or in some other way maybe. This is quite urgent and i hope that i have explained the scenario in enough detail.
    Any help would be greatlly apritiated.
    Best regards
    Peter

    Hello
    Just try this link
    http://www.faqts.com/knowledge_base/view.phtml/aid/13758/fid/53
    HTH

Maybe you are looking for

  • Payment_method_lookup_code in supplier conversion using api

    The conversion is from 11i to R12. I am working on supplier conversion using API. The AP_VENDOR_PUB_PKG create_vendor or create_vendor_site does not have Payment_method_lookup_code to update into apps. How can i update the Payment_method_lookup_code

  • Opening Word docs in InDesign CS4 (Mac)

    Hello everyone. This is my first time asking for help from this forum. I have just upgraded to CS4 from CS2 (Mac) and I have been having numerous issues with Word and InDesign. When I try downloading a fairly complicated Word file into InDesign CS4 i

  • 3 problems with conversion to PDF

    Hi, I am using Adobe Acrobat 6.0 Professional and MS Word 2003. When converting Word documents to PDF, I have these problems: 1) Bright colours in my Word files (red, pink, yellow) turn much darker and duller in PDF. They look kind of dirty red/pink/

  • Import Face from iPhoto doesn't work

    Hi to everyone. I just starting to beliebe if it' s good idea to reinstall Lion. I just want to know if all this is bugs or my system. This days i have to many problems and all have to do with address book. Now the problem is that the button import f

  • CONNECTION OF SPEAKERS TO PAVILION 500 SERIES DESKTOP

    Just bought first desktop PC a Pavilion 500-312ns desktop that came with a Pavilion 22xi  monitor and all seemed fine until i realised that  the monitor has no speakers or  any options to do so .So my question is  how can i connect speakers to the de