cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple sort/subtotal columns in Table or SAP List Viewer

former_member185943
Participant
0 Kudos

Hi,

Is it possible to let the user create sorts and subtotals by multiple columns, similar to ALV grid in GUI? To clarify some more: in GUI ALV grid user can select more columns while holding down the CTRL key before pushing sort or subtotals button, having all the selected fields as sort/subtotal criteria. Is something similar avilable in WDA Table or SAP List Viewer? I know that in SAP List Viewer it can be done programatically, but I wonder is there something for the user?

Thanks!

KR,

Igor

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Igor,

yes, the user can do it in the Settings Dialog, it's descibed here: [Working with Lists|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/43/44165970cc1bcce10000000a1553f7/frameset.htm].

Some of the settings are disabled by default, so you have to check what you allow your users to do, e. g. IF_SALV_WD_TABLE_SETTINGS~MULTI_COLUMN_SORT.

Kind regards

Stefanie

former_member185943
Participant
0 Kudos

Hi, Stefanie,

Thanks - it works!

I am trying to do subtotals, and according to the help that you sent to me, I am suppose to set it up by using the Open Settings Dialog command in the application toolbar. It is supposed to be a little wrench icon. However, I don't see this command. Does it require some more settings, is it a version matter? I am on verision 7.01/0029 (NW trial).

Thanks!

KR,

Igor

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It isn't a wrench Icon. It should just be a link to action hyperlink that says Settings in the uppper right hand section of the ALV. If the ALV table is wider than the browser window then you might have scroll horizontally to see the settings link.

former_member185943
Participant
0 Kudos

Hi,

I was able to use Settings, but I can't see the Calculation tab. The help says: "By default, you cannot make calculations in SAP List Viewer (ALV). However, calculations can be specifically enabled for your application.". How do I enable calculations? I supposed it could be an application parameter, but couldn't find the right one by F4 on app params.

Is it maybe CL_SALV_WD_CONFIG_TABLE->IF_SALV_WD_STD_FUNCTIONS~SET_AGGREGATION_ALLOWED? Can't try it out at the moment, but it sounds promissing.

Thanks!

KR,

Igor

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>How do I enable calculations?

You need to enable the calculations settings during intialization of the ALV. Here is a code sample:

data: l_ref_cmp_usage type ref to if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.

  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
  data l_table type ref to cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).

  l_table->if_salv_wd_std_functions~set_aggregation_allowed( abap_true ).

former_member185943
Participant
0 Kudos

Yes, it works.

Thanks, guys!

KR,

Igor

Answers (0)