07-21-2005 4:58 AM
Hi all,
We have a few programs calling alv grid using the oo method. However, we need to change the program to cater for when users do a filter of the results, so that the number of records shld be dynamic, instead of passed in from the abap program.
Can someone pt me to the correct way of doing this? I would like to avoid using the call function way of calling the alv grid.
DATA : PS_LAYOUT TYPE LVC_S_LAYO.
DATA : TITLE(70).
CONCATENATE 'Records selected : ' COUNTER INTO TITLE.
PS_LAYOUT-GRID_TITLE = title.
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_VARIANT = GS_LAYOUT
I_SAVE = X_SAVE
I_DEFAULT = 'X'
IS_LAYOUT = GT_LAYOUT
CHANGING
IT_OUTTAB = ITAB1[]
IT_FIELDCATALOG = GT_FIELDCAT.
07-21-2005 5:18 AM
Hi Leonard,
When you use the Filter functuionality for the ALV Grid, adjusting the number of rows to satisfy the filter condition will take place automatically.
You can take a look at the example program BCALV_TEST_FULLSCREEN_FILTER. Observe how the number of rows gets changed as you change the filter automatically. These filters can also be set and manipulated programmatically.
Regards,
Anand Mandalika.
07-21-2005 5:18 AM
Hi Leonard,
When you use the Filter functuionality for the ALV Grid, adjusting the number of rows to satisfy the filter condition will take place automatically.
You can take a look at the example program BCALV_TEST_FULLSCREEN_FILTER. Observe how the number of rows gets changed as you change the filter automatically. These filters can also be set and manipulated programmatically.
Regards,
Anand Mandalika.
07-21-2005 5:33 AM
hi anand,
thanks for your help, i mean is there anyway for me to capture the number of rows that is displayed after the filtering has been set.
regards.
07-21-2005 5:41 AM
Hi Leo,
Have you tried using the method GET_FILTERED_ENTRIES ?
Regards,
anand mandalika.
07-21-2005 5:45 AM
That method would give you the list of the indexes of all the entries of the table that have now becme hidden as a result of applyting the filter.
So, you now have the total number of entries in the internal table ans the number of entries that are hidden. you can easily obtain the number of entries that are being displayed.
Lemme know if that helped. If yes, reward points and close the thread. Otherwise get back with any problem that you may be facing.
Regards,
Anand Mandalika.
07-21-2005 6:38 AM
Pls bear with me, i'm very new to abap alv programming.
Does this mean i have to declare a event handler, and when a filter action is being done, i have to call the alv grid again? updating my header as needed.
What i need is something like this:-
Number of records : 100 "GRID-TITLE
ALV Grid with 100 records.
*Users filter resets to 50 records.
Number of records : 50 "GRID-TITLE
ALV Grid with 50 records.
07-21-2005 6:50 AM
That is correct. Just give it a try and let me know if you're facing some problems doing that.