on 07-23-2010 9:46 AM
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?
Hello,
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
lo_nd_scarr->bind_element(
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!
Regards,
Srilatha M
Edited by: Srilatha M on Jul 23, 2010 11:31 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.