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: 

Filter with CL_GUI_ALV_TREE

Former Member
0 Kudos

Hello,

does anybody know how I could build a button to filter for the CL_GUI_ALV_TREE? I don´t seem to be able to find any event/method in the alv tree that could handle this.

Or... Maybe I could create an instance of the CL_GUI_ALV_GRID and use the filter function there for my tree (same fieldcat) and raise the event in a custom class. Does anyone know the event that is raised when filter is executed? It seems the events are entered into table EVENT_STACK, and accessed with method GET_EVENT_PARAMETER (CL_GUI_CFW) called within method DISPATCH (CL_GUI_ALV_GRID).

Thanks for all answers,

Kevin

5 REPLIES 5

Former Member
0 Kudos

Hi kevin,

You can set the filter option with the method call

<b>SET_TABLE_FOR_FIRST_DISPLAY</b>

Create a button may be a toolbar and change the filter options and then call <b>REFRESH_TABLE_DISPLAY</b>

both these methods internally call set_filter and apply filter methods resp.

hope this helps.

Regards,

Kinshuk

0 Kudos

Hello Kinshuk,

thanks for your answer.

I tried to fill the IT_FILTER parameter but am unsure what to fill for the fields LOW, HIGH, SIGN etc.

If I create a button in the toolbar, how do I call the filtering function?

Also, looking at the method, I think the filter could work for the fields in the fieldcat but not the node fields since they aren´t part of the fieldcat structure.

Do you have an example or maybe some doucmentation for this?

Thanks a lot,

Kevin

0 Kudos

Hi Kevin,

I have an alternative solution,

when you add the node to the tree there is a parameter IS_NODE_LAYOUT in the method add_node.

set the HIDDEN parameter for this to space.

and when you want to apply the filter option change the hidden field of this parameter to 'X'

and update the tree by using method CHANGE_NODE.

refresh the tree using method REFRESH_TABLE_DISPLAY

i don't exactly have a example for this.

may be you can refer the following programs.

BCALV_GRID_DND_TREE

BCALV_TREE_01

BCALV_TREE_02

BCALV_TREE_DEMO

Hope this helps.

Regards,

Kinshuk

0 Kudos

Hello Kinshuk,

thanks for your answer. I tried it out but I think its not what I´m looking for.

The customer would like a pop-up window, like the filter functionality in the CL_GUI_ALV_GRID, where they can choose the fields to filter. As far as I saw, this cannot be done in the CL_GUI_ALV_TREE. Thats why we considered creating a dummy instance of the GRID and trying to raise the event for the filter so as to use the filter functionality in this way. Probably cannot work either.

Tahnks for your help,

Kevin

0 Kudos

Hi Kevin,

I'm also working on ALV tree these days.

The Note 690295 explains that it's impossible to define filter function for CL_GUI_ALV_TREE.

So I believe your understanding is correct.

Thanks for this useful discussion.

Cheers,

David