04-02-2008 1:07 PM
Hy experts
How to display a fixed number of rows in a page when using CL_GUI_ALV_GRID?? lets say 500 ?? because my display table it may contain in some cases 10.000 and evidently I can t see all of them..
I have a button in my toolbar witch triggers this event
(display 500 records ) but I don t have the logic to do this only with methods of CL_GUI_ALV_GRID.
can you tell me a standard method of CL_GUI_ALV_GRID witch can help me do this?? any hint will be good..
Till now I was used to add a column to my structure witch represents a flag that is a number corresponding to every 500 records (a batch containing 500 records )
first 500 - flag -> 1
second 500 - flag -> 2
etc..but I m convinced that exists a way of doing this more easy..without damaging my structure..
thanx in advance..don t be shy..reply if you have any hints..
04-02-2008 1:19 PM
Hi,
if method SET_FILTER_CRITERIA doesn´t help, I think that you must work with 2 internal tables, a counter and a loop for filtering the records to be displayed:
case counter.
when 1.
loop at int_table1 from 1 to 500. "<-- your table with all records
move int_table1 to int_table2
endloop.
when 2.
loop at int_table1 from 501 to 1000.
move int_table1 to int_table2
endloop.
etc, etc.
Call grid-->SET_TABLE_FOR_FIRST_DISPLAY
exporting
IT_OUTTAB = int_table2 "<-- instead of your currently table int_table1
04-02-2008 1:19 PM
Hi,
if method SET_FILTER_CRITERIA doesn´t help, I think that you must work with 2 internal tables, a counter and a loop for filtering the records to be displayed:
case counter.
when 1.
loop at int_table1 from 1 to 500. "<-- your table with all records
move int_table1 to int_table2
endloop.
when 2.
loop at int_table1 from 501 to 1000.
move int_table1 to int_table2
endloop.
etc, etc.
Call grid-->SET_TABLE_FOR_FIRST_DISPLAY
exporting
IT_OUTTAB = int_table2 "<-- instead of your currently table int_table1
04-02-2008 1:39 PM
Thanx a lot..
indeed I have thoght of this and the counter It doesn t have to be flag into my structure....
I start from 0 and I increase or decrease the counter according to witch button from toolbar ( previos page or next page )
2 structure : 1 full table
1 fixed table of 500 records of the same type like the full table
But ..instead of case I can put like 2 variables v1 and v2 and loop into this variables like index..
thanx again..thery helpfull..