Application Development and Automation 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: 
Read only

update/refresh a simple tree (cl_gui_simple_tree)

Former Member
0 Likes
1,953

Dear Ladies and gentleman,

i have a problem with updating/refreshing a simple tree (cl_gui_simple_tree).

Situation:

when i start my 'tree-dynpro' the first time, the tree is displayed correctly. But the tree can be extended by the user via clicking a button 'create new node' e.g.. Therefore a new dynpro will be opened where the user can fill in new data. after clicking the 'save'-button the new entry will correctly stored in my database. and my node-table is also correctly built with the new entry. but my tree doesn't show the new entry. i have to close my program and restart it to view the changes. how can i refresh the tree in realtime without restarting my whole program.

Thanks a lot for your help,

Marcel

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
974

Hello Marcel

The sample report<b> BCALV_DND_01</b> shows how to add nodes to the tree using <i>Drag&Drop</i>.

In your scenario when the user pushes the CREATE button your application handles the user-command at PAI of the dynro including the adding of the new node to the tree.

In this scenario PAI is followed by PBO of the dynpro where the flushing should occur automatically.

However, if the push button is part of the toolbar then PAI is not passed. In this case you may try the following trick:

(1) Add the following coding to the method handling the user-command:

... " add node to tree

  CALL METHOD cl_gui_cfw=>set_new_ok_code( 'REFRESH' ).
" NOTE: this will trigger that PAI of the dynpro is passed

(2) Add the following coding in the <b>PAI </b>module handling the user-commands of the dynpro (e.g. USER_COMMAND_0100):

  case gd_okcode.
    WHEN 'REFRESH'.
      CALL METHOD cl_gui_cfw=>flush( ).  " flushing

    WHEN ...
  endcase.

Regards

Uwe

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
975

Hello Marcel

The sample report<b> BCALV_DND_01</b> shows how to add nodes to the tree using <i>Drag&Drop</i>.

In your scenario when the user pushes the CREATE button your application handles the user-command at PAI of the dynro including the adding of the new node to the tree.

In this scenario PAI is followed by PBO of the dynpro where the flushing should occur automatically.

However, if the push button is part of the toolbar then PAI is not passed. In this case you may try the following trick:

(1) Add the following coding to the method handling the user-command:

... " add node to tree

  CALL METHOD cl_gui_cfw=>set_new_ok_code( 'REFRESH' ).
" NOTE: this will trigger that PAI of the dynpro is passed

(2) Add the following coding in the <b>PAI </b>module handling the user-commands of the dynpro (e.g. USER_COMMAND_0100):

  case gd_okcode.
    WHEN 'REFRESH'.
      CALL METHOD cl_gui_cfw=>flush( ).  " flushing

    WHEN ...
  endcase.

Regards

Uwe

Read only

0 Likes
974

it works

thanks a lot