Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV tree - change node text

Former Member
0 Kudos

hello,

on a screen I have input fields such as year and below a container holding an ALV tree.

When I change the year value, that starts a new selection from a table and should result in changing many of the lines in the tree.

I was trying to use the methods "get_outtab_line" to retrieve the tree line data and then changing this data with method "change_node".

The problem is I cannot access the correct node-key. The node-key value is kept in memory somewhere and when I refresh the alv tree at PBO, the node-key is incremented from the stored value which means I cannot use get_outtab_line properly.

Any suggestions or example programs,

Thanks a lot,

Kevin

4 REPLIES 4

Former Member
0 Kudos

Hi Kevin,

Here is one approach that might work actually,

Use get_top_node method of ALV Tree to get the top node key every time you refresh and then add this to the node key that you have already stored before calling get_outtab_line.

Hope this helps..

Sri

0 Kudos

Hello Sri,

thanks for the tip. Unfortunately I don´t think it helps my case.

I tried deleteing the tree with method FREE and then building up the tree exactly the same way as before but with new data. But now the tree is not shown at all...

although I use methods "set_table _for firstdisplay" and "frontend_update" .

Any idea maybe?

Thanks,

Kevin

0 Kudos

Hi Kevin,

Try using method update_calculations instead of directly using frontend_update.

So the sequence should be,

IF NOT ref_tree IS INITIAL.

CALL METHOD ref_tree->free.

ENDIF.

CREATE OBJECT ref_tree...

CALL METHOD ref_tree->set_table_for_first_display...

****Data fill in a loop

.....

CALL METHOD ref_tree->add_node..

.....

****Expand if needed

CALL METHOD ref_tree->expand_node..

****Toolbar Logic if needed..

****Events Registration

****Finally call to update calculations

CALL METHOD ref_tree->update_calculations..

Hope this helps..

Sri

0 Kudos

Hello Sri,

thanks for your help.

I found the problem, at the bottom of PAI section, I forgot to clear the reference for the container and not just for the tree.

Cheers,

Kevin