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: 

Problem in CL_GUI_ALV_TREE implementation

Former Member
0 Kudos

Hi all,

I am creating a functionality using CL_GUI_ALV_TREE. In my screen PAI, i have the foll. code

IF tree1 IS INITIAL.

PERFORM init_tree1.

ENDIF.

CALL METHOD cl_gui_cfw=>flush.

This code gets triggered on click of a button in a screen. This button can be clicked more than once without re-loading the program. When doing so, as the TREE1 field is holding a value, when the button is clicked the second time, i get an runtime error. Is it possible to detsroy this tree, so that that PAI can get executed again?

8 REPLIES 8

Former Member
0 Kudos

Hi Suryanarayan.

If you want to refresh the data displayed in the treeview, then you should just call method REFRESH_TABLE_DISPLAY.

If this is not what you want to do, then just CLEAR tree object.

Hope it Helps.

Jesus

0 Kudos

Hi Jesus,

REFRESH_TABLE_DISPLAY is a private method in CL_GUI_ALV_TREE and so I am not able to use it in my program. CLEARing the tree object is not solving the case either. Any other suggestions, please do let me know.

0 Kudos

Hi... try calling method free.

0 Kudos

Hi,

FREE has been already used.

This is my PBO code:

CASE ok_code.

WHEN 'BACK' or 'CANCEL'.

CALL METHOD tree1->free.

CLEAR ok_code.

LEAVE TO SCREEN 0.

WHEN OTHERS.

CALL METHOD cl_gui_cfw=>dispatch.

ENDCASE.

CLEAR ok_code.

CALL METHOD cl_gui_cfw=>flush.

As you can see the problem is that the object tree is not getting destroyed when the button the triggers the ALV tree is clicked again.

Would appreciate any help on this.

Thanks.

0 Kudos

Hi,

what is your Button Code. i can't see where you are handling it.

and more over this code should be under PAI not in PBO

<i>This is my PBO code:</i>

CASE ok_code.

WHEN 'BACK' or 'CANCEL'.

CALL METHOD tree1->free.

CLEAR ok_code.

LEAVE TO SCREEN 0.

WHEN OTHERS.

CALL METHOD cl_gui_cfw=>dispatch.

ENDCASE.

CLEAR ok_code.

CALL METHOD cl_gui_cfw=>flush.

regards

vijay

0 Kudos

Hi Vijay,

Sorry for the confusion caused..

The part of the code is in my PAI only (a typo in my previous message). Any suggestions you have?

0 Kudos

Hi,

if you click that Button Free the tree and repopulate the tree. but i can't see any where in your code How you are handling that Button, and is it done with others.

Regards

vijay

Former Member
0 Kudos

Hello Sury,

Try method frontend_update( ) after you made the changes on your Tree control.

Thanks and regards,

Eduardo