Skip to Content
avatar image
Former Member

Table Control in Web dynpro

Hi experts,

      I have created one table and created three columns for it. All these columns are having drop down by key cell editor. I am unable to create three records during runtime but i should give a provision to add as many contacts as the user required.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 10, 2012 at 01:18 PM

    Hi,

    In WDDOINIT method, use

    APPEND INITIAL LINE TO <itab name>

    ex:

    DATA lo_nd_tab TYPE REF TO if_wd_context_node.

       DATA lt_tab TYPE wd_this->Elements_tab.

    *   navigate from <CONTEXT> to <TAB> via lead selection

       lo_nd_tab = wd_context->get_child_node( name = wd_this->wdctx_tab ).

       DO 3 TIMES.

         APPEND INITIAL LINE TO lt_tab.

       ENDDO.

       lo_nd_tab->bind_table( lt_tab ).

    here tab is the name of node to which you binded  your table UI.

    if you want 5 records append 5 initial lines. or keep one button ( + add rows ) and onclick of that button you can append one initial line and re-bind the table.

    Hope this helps u.,

    Thanks & Regards,

    Kiran.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank You Kiran,

      I have applied the same logic and set the DO loop for 30 times but i think the button feature is good and also increases the performance.

  • avatar image
    Former Member
    Apr 17, 2012 at 09:44 AM

    Hi,

    While inserting the rows into the table control, use the info node and create the value set table which is to be displayed in the dropdown list.

      data: lo_nd_node type ref to if_wd_context_node,

              lo_el_node type ref to if_wd_context_element,
            node_ddc type ref to if_wd_context_node_info.


      data: lt_valueset type wdr_context_attr_value_list,
            l_value type wdr_context_attr_value.

      lo_nd_node = wd_context->get_child_node( name = 'NODE' ).

      node_ddc = lo_nd_node->get_node_info( ).

    *

    * Create the value set table. "lt_valueset"

    * Value set has fields: value and text.

    *

    node_ddc->set_attribute_value_set( name = '<field_name>' value_set = lt_valueset ).

    lo_el_node =  lo_nd_node->bind_structure( new_item = ls_node
                                   set_initial_elements = abap_false index = sy-tabix ).

    <Fieldname>: the name of the column which you want to display in the dropdown list.

    Whenever you insert any row in the table control, it will bind that column with the multiple values and display in the dropdown list.

    -Regards

    Ketan.

    Add comment
    10|10000 characters needed characters exceeded