cancel
Showing results for 
Search instead for 
Did you mean: 

Table - totals and subtotals with filter

Former Member
0 Kudos

Hi,

I'm using Table UI control and I need to calculate sum value of specified column of displayed values. I use filter in this table what means that I need to recalculate sum after each filter event and sum only displayed values in the table control. How to achieve this?

I have read some articles about adding a row into itab and sum values into this new row and bind this itab into table, but this doesn't solve the problem with filter.

Many thanks for any reply.

Regards Jiri Neuzil

Accepted Solutions (0)

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

Hi Jiri,

have you thought of having a separate table for your sums/totals?

Either that - and handle the totaling in your table's onFilter event - or sounds like you'll have to build your own table filter handler! Having done that with WD Java because of limitations in the supplied filter handler, it was a reasonable bit of work - but at least CL_WDR_TABLE_METHOD_HNDL is a lot better than the Java one I had to use as a model.

You could create your own filter handler to implement IF_WD_TABLE_METHOD_HNDL and IF_WD_VIEW_ELEMENT_METHOD_HND.

Unfortunately CL_WDR_TABLE_METHOD_HNDL is final - so you can't subclass it - but you could at least hand off most of the calls to an instance of it.

Good luck!

Chris

Former Member
0 Kudos

Hi,

I want to have same sum funcionality as ALV has. This means sums are calculated for specified columns only for visible (not filtered) rows. When I apply filter I want to recalculate sum only for not filtered column values.

Regards Jiri