02-07-2008 7:28 AM
Hi,
I need some help in hiding particular rows in an ALV Grid without affecting the total sum at the end of the table. I am trying to hide the rows that have negative quantities, but I still need those values so that the user can still compute for the total sums. Can anyone help? Thanks.
Joseph
05-25-2008 8:57 AM
05-26-2008 11:09 AM
yess
u can use no col in field catalouge ..
or else make one more internal table with rows which u need to display and pass it to grid disply
cheers.,
05-26-2008 11:10 AM
select internal table with upto rows or give condition and pass it to grid display..
05-26-2008 11:40 AM
After suming up all u just delete those records which u do want..
as per condition
if it is usefull Plz Reward
regards
Anbu
05-26-2008 12:12 PM
Hi,
Hopw this way you can hide the rows in the GRID.
DATA:
ld_column TYPE lvc_fname,
ld_hide TYPE abap_bool.
FIELD-SYMBOLS:
<ls_entry> TYPE any,
<ld_fld> TYPE any.
ld_column = 'COL_1'. " column which you want to suppress if everything is zero
ld_hide = abap_true. " = 'X'; default hide column
LOOP at <gt_outtab> ASSIGNING <ls_entry>.
ASSIGN COMPONENT (ld_column) OF STRUCTURE <ls_entry> TO <ld_fld>.
IF ( <ld_fld> > 0 ).
ld_hide = abap_false. " display column because at least single value > 0
EXIT. " leave LOOP
ENDIF.
ENDLOOP.
READ TABLE gt_fcat INTO ls_fcat
WITH KEY fieldname = ld_column.
IF ( syst-subrc = 0 ).
ls_fcat-no_out = ld_hide.
MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
ENDIF.
hop you will get the total with for those columns too.
Regards,
Madhavi
05-26-2008 1:38 PM
1) i dont want to hide COLOUM but ROW..
2) I am summing up by using do-sum = 'x' in field cataloug.
so if i delete the record b4 display,the deleted record will not effect the SUM..(i.e i want the deelted record to b considered for SUM but shouldnt be displayed)
03-18-2011 10:19 AM
Have u got the solution for hiding the row in ALV? , if pls send me the code and solution...
03-02-2016 8:59 AM
06-02-2008 11:18 AM
You can sum up the records inside the program and store them in another internal table. Use this table to display only the sum in the alv output. With this you can have something like summary and details options.
06-03-2008 4:19 AM
yah u can do it,
1)
pass it_filter to FM "reuse_*** _alv"
in it_filter u can filter values > 0.
2) go to output
select the sum column , goto filter put condition " > 0"
save this layout.
and set this layout in ur program.
03-18-2011 12:34 PM
03-18-2011 5:24 PM
It is still very simple:
First register the subtotal event in your alv (link with a subroutine).
Display the alv with your reduced rows.
When the subtotal event is triggered (before display)
You get the subtotal line and can overwrite it with your own values(maybe in an internal table with the whole content).
You have to check if it is a subtotal or total.
you can hide the sumup functions in the toolbar to reduce confusion....
But still set the columns where you want to sum_up in the fieldcat to max_value to avoid a field overflow.
Your own values will be overwritten, when colum is set to AVG!.
Regards,
Christian