Showing results for 
Search instead for 
Did you mean: 

insert row in a table (not ALV)

0 Kudos

Hi there,

i know, i can insert a row in a table in 3 steps:

1. get_static_attributes_table

2. insert line into table

3. bind_table

Is there another way possible maybe one without reading the whole table?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos


If your requirement is to add a row to the TABLE i.e. adding a context element to the context node which is bound to the TABLE, then you can do the following:

 DATA lo_nd_scarr TYPE REF TO if_wd_context_node.
 DATA lo_el_scarr TYPE REF TO if_wd_context_element.
lo_nd_scarr = wd_context->get_child_node( name = wd_this->wdctx_scarr )."get the reference to the context node

lo_el_scarr = lo_nd_scarr->create_element( ). "create a context element
lo_el_scarr->set_attribute( name = 'attr_name' value = 'attr_value') "set the attributes 
new_item = lo_el_scarr
set_initial_elements = abap_false ). "bind the created element to the context node

Hope this helps!

If this is not the info which you are looking for, please revert back!


Srilatha M

Edited by: Srilatha M on Jul 23, 2010 11:31 AM

0 Kudos

So far, youre solution works.

There's only problem. Is it possible to insert a line at a certain position/row in the table? With youre solution, the new line is appended at the end of the table...

Forget it. One minute after posting i found out that the bind_element-method offers a parameter "index"

Problem solved!!

Edited by: David Wallner on Jul 23, 2010 12:29 PM

Answers (0)