Skip to Content
0

Can't change image and text of the node in CL_GUI_LIST_TREE dynamically

Dec 12, 2017 at 12:06 PM

33

avatar image
Former Member

I have to change the node icon and node text at runtime from internal table, but not able to do, I have tried class CL_GUI_LIST_TREE with all necessary methods but can't update node image and node text. It shows only image and text which was assigned at first time tree execution.

Thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sandra Rossi Dec 12, 2017 at 02:48 PM
0

No issue for me. I duplicated SAPTLIST_TREE_CONTROL_DEMO, added the following code in method HANDLE_NODE_DOUBLE_CLICK, tested by double-clicking any node (not an item), and the new icon reflected immediately:

    CALL METHOD G_TREE->node_set_n_image
      EXPORTING
        node_key          = 'Root'
        n_image           = '@5B@'    " green light
      EXCEPTIONS
        failed            = 1
        node_not_found    = 2
        cntl_system_error = 3
        others            = 4.
    CALL METHOD G_TREE->node_set_exp_image
      EXPORTING
        node_key          = 'Root'
        exp_image         = '@5B@'
      EXCEPTIONS
        failed            = 1
        node_not_found    = 2
        cntl_system_error = 3
        others            = 4.
    CALL METHOD G_TREE->item_set_t_image
      EXPORTING
        node_key          = 'New1'
        item_name         = '1'
        t_image           = '@5B'
      EXCEPTIONS
        failed            = 1
        node_not_found    = 2
        item_not_found    = 3
        cntl_system_error = 4
        others            = 5.
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks,

This seems to be working fine.

0