cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically change table column properties

Former Member
0 Kudos

Hi Experts,

Sorry for asking this question, i think its fairly simple but i couldnt find the code for it.

I need to dynamically change the sort state for a table column based on some button action. I tried binding the property to a attribute but it doesnt work. I am guessig the whole code has to be dynamic, refering to CL_WD_TABLE_COLUMN.

Thanks for you help.

Regards,

Pris.

Accepted Solutions (0)

Answers (1)

Answers (1)

amy_king
Active Contributor
0 Kudos

Hi Prisford,

Check out web dynpro component DEMO_TABLE, view SORT_AND_FILTER_VIEW to see how to include column sorting in your table.

If you need to sort via an explicit button click, the action handler for the button could read the table of data from the node (method get_static_attributes_table), resort the table with the SORT keyword, then re-bind the newly-sorted table to the node.

  node->bind_table(
    new_items            = lt_table
    set_initial_elements = abap_true ).

Cheers,

Amy

Former Member
0 Kudos

Hi Amy,

I was able to include sorting in the coulmns. I wanted a way to display the table data without me having to manipulate the context node.

i.e. by setting the table property through code.

So, even the filter, i should be able to filter dynamically without having to change my context.

Thanks,

Pris.