Skip to Content
avatar image
Former Member

Using table entry selection

I have a table that is used to display data. I would like to select a row and use that as input. Does anyone know what method to use?

I have a table that displays inspection lot details, selecting a row and click on view should use the inspection lot number to display inspection lot results.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Feb 02, 2010 at 04:41 PM

    Hi ,

    When you select any row in overview table then the corresponding context node bind to it will have its lead selection property set, simply fetch the lead selected row using below mentioned methods, then invalidate the context node containing detail data, use fetche data as input - find detail data then bind the detail data node back to corresponding context node.

    * ---------First fetched selected row data in overview ALV------------------------
      DATA lo_nd_et_due_disp_agg_all TYPE REF TO if_wd_context_node.
      DATA lo_el_et_due_disp_agg_all TYPE REF TO if_wd_context_element.
      DATA ls_et_due_disp_agg_all TYPE wd_this->Element_et_due_disp_agg_all.
        lo_nd_et_due_disp_agg_all = wd_context->path_get_node( path = `GET_DUE_AGG_A_RFC.EXP_GET_DUE_AGG_A.ET_DUE_DISP_AGG_ALL` ). " get node ref
    * by default index is Use_lead_selection- the selected row in overview ALV
        lo_el_et_due_disp_agg_all = lo_nd_et_due_disp_agg_all->get_element(  ). "get selected element
    * get all declared attributes
            static_attributes = ls_et_due_disp_agg_all ).

    Basically method get_element and get_static_attributes will be required.


    Manas Dua

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 03, 2010 at 05:43 AM

    Hi Megan,

    For displaying the table data we have a node with cardinality 0:n Now add another attribute to that table node as Read_only of type wdy_boolean with default as abap_true or X..

    Now add all the table columns includng read only column also (make the read_only column as invisblle) now in the table column insert the Input field instead of Text view.

    Now go to lead slection method . Say get_static_attributes this will fetch the lead slected values in the table . set the read only property for that lead selected value as read_only = abap_false. .. Modify this value with the whole table data may be can loop and bind the table data.. Simple this will giv you the allow you to enter the values in the table..

    Hope it might be helpful to you Try this ! If further help needed plz get back.

    Have a Good Day!.



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 03, 2010 at 05:46 AM

    Just read the node binded to table using Code wizard(control + F7). This will give you data of row selected by you and same code as given by Manas will be generated.

    Add comment
    10|10000 characters needed characters exceeded