Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Add new row in table

Hi,

I have a table UI element with data in it.

When i click on Add Row button, an empty row should get added in to the table UI element.

Can anybody help me out as to how to do this?

Regards,

Kanakaraj V A

Former Member
replied

Hi Kanakaraj,

This is the complete code that you should use for adding a record at the beginning of the table:

method ONACTIONADD_ROW .
  data: wd_node type ref to if_wd_context_node,
        wa_data type wd_this->element_sflight,
        count type i.
  wd_node = wd_context->get_child_node( name = 'SFLIGHT' ).
  count = wd_node->get_element_count( ).
  count = count + 1.
  wd_node->bind_structure( new_item             = wa_data
                           index                = 1
                           SET_INITIAL_ELEMENTS = ABAP_FALSE ).
endmethod.

This code is working fine for my component. Just check it out.

Regards,

Uday

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question