cancel
Showing results for 
Search instead for 
Did you mean: 

Why does GET_STATIC_ATTRIBUTES or SET_STATIC_ATTRIBUTES change lead selecti

daniel_humberg
Contributor
0 Kudos

I loop over all elements of a context node, and change some attributes.

The code looks like this:


      LOOP AT lt_element_list INTO lo_el_element.
        lo_el_element->get_static_attributes( IMPORTING static_attributes = ls_element ).
        ls_element-created_by_name  = get_user_name( iv_user_id = ls_element-created_by ).
        ls_element-changed_by_name  = get_user_name( iv_user_id = ls_element-changed_by ).
        lo_el_element->set_static_attributes( EXPORTING static_attributes = ls_element ).
      ENDLOOP.

This coding seems to change the the lead selection of the context node, which leads to problems somewhere else.

Why does it change the lead selection and how can I prevent it?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi daniel.....

i dont think there is a need for looping in this manner.

you just get all the values of a node into an internal table.

and then loop the internal table an make changes in it.

then clear the node and pass this currently changed internal table into the node.

the lead selection changes because you are setting the attribute and it might be stored in index 1 or the to the index where the lead selection is referred to. this might be your problem.

---regards,

alex b justin

daniel_humberg
Contributor
0 Kudos

How do I get all the values of a node into an internal table?

Former Member
0 Kudos

hi daniel...

click the code wizard....

use read attribute option,

mention the node name that has to be read,

it will automatically pass teh values to an internal table.

---regards,

alex b justin

daniel_humberg
Contributor
0 Kudos

Hi Alex,

you are right, I can also read the whole table at once, using GET_STATIC_ATTRIBUTE_TABLE and BIND_TABLE.

However, this does not solve my problem, since BIND_TABLE also seems to change the lead selection.

Regards, Daniel

Former Member
0 Kudos

hi daniel.......

one sugestion for you:

before reading the table, first read the lead selection,

then loop the internal table and before passing it to the node make sure that the lead selection is set to the previously selected value.

generally lead selection, by default, is set for the first row.

---regards,

alex b justin

Answers (0)