07-27-2011 9:08 AM
All,
I have searched a lot in this forum this answer, but could not find any nearest one.
I am using CL_SALV_TABLE (SALV) for an ALV report. I wanted to hide some rows based on some condition say for example
in the ALV one of the column is MATNR say i wanted to hide rows that having MATNR less than 1000.
How we can do this ?
Thanks
a®
07-27-2011 9:11 AM
Hi,
the standard alv functions offer a filter. Doesn't this meet your requirements?
Best regards,
Oliver
07-27-2011 9:22 AM
Oliver,
Thanks for your reply.
If have used the filter those line will not reflect in the total. I wanted only lines to be hide and for totalling that hided lines to be considered.
I know this quite odd. but the requirement is like that.
a®
07-27-2011 9:42 AM
HI!
I think u first calculate total in internal table. save that totals into some veriable and then remove those lines which u dont want to show from internal table and then calculated total append into that internal table .
I thinks it will work!
all the best!
07-27-2011 10:05 AM
07-27-2011 11:16 AM
Hi a®s,
the ALV/SALV standard will always take into consideration only visible data for totals calculation. If i were a user I would always expect the total as the sum of what I see.
Hidden secret knowledge is always dangerous. Try to persuade the requiring people to accept that you give the to-be-filtered-out-but-included-in-total lines just another color, i.e. light grey or what ever they like.
If you create buttons for filters for, say, show all with colored filtered rows, show only filtered out lines, show only remaining lines, the user can also see the different totals which may add up information value.
If people insist on the requirement, disable SUM and create your own total line.
Regards
Clemens
07-27-2011 12:30 PM
Clemens,
You are right, In ALV/SALV what we see only get total.
So i decidied to remove the sorting and filtering buttons from toolbar and TOTAL lines will display in different color.
(If we given sorting and filtering then user can change sequence)
Thanks
a®
10-25-2011 8:50 AM
Good day, everyone!
Ive faced the same issue - I either have to hide a row or to change subtotal line manually.
Have anyone solved this already?
HI!
> I think u first calculate total in internal table. save that totals into some veriable and then remove those lines which u dont want to show from internal table and then calculated total append into that internal table .
> I thinks it will work!
> all the best!
I can't find anything that looks like a table for subtotals - they are counting somewhere inside SALV.
Or, maybe, you know something that I dont?
If people insist on the requirement, disable SUM and create your own total line.
Add my own total line? How can I do this?
10-25-2011 1:36 PM
You can implement Static Filter on SALV to hide your rows from coming on the ALV display. This way Total / Subtotal wont recognize them.
Check [SALV Static Filter|http://help-abap.zevolving.com/2011/10/salv-table-16-static-filters/]
Regards,
Naimesh Patel
10-25-2011 4:25 PM
Hi Volodja,
adding own total line isn't for beginners, but it's not too hard:
After you have your table ready for display, you add one more line. In this line you put the total values according to your own definition (we did something like that with totals of weighed averages). This line will get the color COL_TOTAL (yellow) of type-pool COLOR.
But to keep it consistent, you must disable filter, sorting and totaling functionality in the ALV display.
Regards,
Clemens
10-26-2011 11:57 AM
Good day and thanks for replies!
Hi Volodja,
> After you have your table ready for display, you add one more line. In this line you put the total values according to your own definition (we did something like that with totals of weighed averages). This line will get the color COL_TOTAL (yellow) of type-pool COLOR.
Unfortunately, that doesn't fit me well - I need subtotals as technical rows in case of exporting to excel.
http://imageshost.ru/photo/88647/id994202.html
original SALV is to the left and required one is to the right
07-27-2011 10:47 AM