‎2009 Apr 13 6:46 PM
I retrieve data from SFLIGHT table and display it in ALV by using cl_salv_table class. I added a sorting column PRICE as follows:
data r_salv_sort type ref to cl_salv_sorts.
r_salv_sort = r_salv_table->get_sorts( ).
r_salv_sort->add_sort('PRICE').
and got exception message:
Subtotals cannot be calculated on aggregatable columns
it is fine when I change from PRICE column to CONNID column.
What could be the reason for that? I just want to sort the Price column. Thanks!
‎2009 Apr 13 6:51 PM
Check this discussion on SORT for Numeric Column:
Regards,
Naimesh Patel
‎2009 Apr 13 6:51 PM
Check this discussion on SORT for Numeric Column:
Regards,
Naimesh Patel
‎2009 Apr 13 7:00 PM
Hi,
I read the thread and it is a workaround, not a solution by the way. Move the numeric column to another non-numeric column, sort it and hide the numeric column.
I still can do the sorting via user interface by right click on the numeric column. So is there anyway to do that in code? thanks!
Best regards,
Anthony
‎2009 Apr 14 6:56 PM
We can do the sorting on the Quantity or Amount column once it ALV is displayed. Because now the control is no more with the SALV model. It is with the ALV framework.
SALV model doesn't allow the sorting on the columns on which you can perform the Agreegation.
You can save the default layout variant and then start the ALV with that variant.
Regards,
Naimesh Patel
‎2009 Apr 13 6:53 PM
HI,
Sort cannot be performed on the quantity,float and currency fields on which aggregate Function applies.
‎2009 Apr 13 7:27 PM
I agree to the point mentioned by avinash !
What you can do is create a field with char attributes and assign the price value to it.
Now to sort the table you can use this field.
While displayin in ALV you can hide this field.
or
You can always use sort option after the output.
Regards,
Lalit Mohan Gupta.
‎2009 Apr 13 9:15 PM