cancel
Showing results for 
Search instead for 
Did you mean: 

Multicolsorting not working in Webdynpro Table Control

Former Member
0 Kudos

Hello,

I want to enable Multicolsorting working in tablecontrol.I dont want to use webdynpro ALV.

Single column sorting is working. But when i press control and click on second column, sorting is not happening.

Also sorting is considering empty rows in my table control.

has anyone faced a similar problem.

I searched in SDn and couldnt find a matching example/situation.

Please help.

Thanks,

Linda

Accepted Solutions (0)

Answers (3)

Answers (3)

0001071915
Member
0 Kudos

Hi,

Just in case you're wondering how to make it work. From my experience, the answer is - you have to develop the multisorting code by yourself. It doesn't seem to be a built in functionality. Enabling multiColSorting property in WebDynpro's View Table definitely allows to have a field MULTIPLE in UI parameters with action onSort. It's abap_true ('X') when the multiple sort is triggered, abap_false (' ') when not. Mentioned by abhinav.sharma as well.

But the usually used in examples method wd_this->table_method_handler->apply_sorting( ), where table_method_handler is of type IF_WD_TABLE_METHOD_HNDL and it's your newly created WebDynpro View attribute, allows you only to sort one column. It won't work when you want to sort more than one column.

Assuming you have already single column sorting work, you can solve this f.ex. by sorting columns dynamically according to TableColumn IDs inside WebDynpro table. To accomplish this, you can use such methods as:

wd_this->table_method_handler->get_all_columns( ) " returns a column table

When iterating at columns table, use:

single_column->get_sort_state( ) " returns which way in WebDynpro table the column is set to be sorted: '00' - ascending, '01' - descending, '02' - none (no sorting applied), which you can use to set a DESCENDING property of sort table used in SORT BY

single_column->get_id( ) " returns associated WebDynpro TableColumn ID from your view, which you can use to fill property NAME of sort table used in SORT BY

Once you've iterated over all these columns, set their names accordingly to your original table and know how a client set them to be sorted (or not), you can simply use your sort table as I did here in this code (this is the base concept, you probably need to modify all lines where the context node table is mentioned and it should work):

https://gist.github.com/TeeKay18/4ec2d7117ea0587d9e66623968d1cf51

PS Getting ID and parsing it probably is not the greatest implementation and requires WebDynpro ColumnTables IDs match in the same recognizable pattern to column names in original table, but when done carefully, it can surely work the way you like. If someone can improve it by directly getting the binded column name corresponding to the original table, feel free to share your method as well.

Former Member
0 Kudos

Hello Linda,

Please check this properties displayEmptyRows and selectionMode on below link

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/6e/ae0e422dfcdc2ce10000000a1550b0/content.htm

you will get some ideas. Also check whether your node is declared as singlton or not so that values can be refreshed after every selection.

Regards,

Sudhir Kothavale

Abhinav_Sharma
Contributor
0 Kudos

Hi Linda,

Multi column sorting functionality depends up on the version of SAP NW. It is available from SAP NW7.0 Ehp 1 onwards.

If you are using version prior to that you can not use multi sorting. Reference:

Table Events (SAP Library - Web Dynpro for ABAP)

To find out do one thing, When you create the action for the onSort event of the table, transfer the UI parameters also. Check if you are getting MULTIPLE as described in above reference, if not then you can not do the multi sorting.

~Abhinav

Former Member
0 Kudos

Hello Abhinav,

We have the correct release and MULTIPLE paramter is there.

But still not working.

Do you have any clues?