Alv Sort and Grouping
I have made an ALV report where I am sorting on the second column which is a field called 'SUPPLIER_ID'.
I am to group the supplier_id, so that only the first row shows the supplier id, and those rows with the same id should not be shown. But am having trouble with this.
check Supplier ID field2 field3
xxxxx xxx xxx
xxxxxx xxx xxx.
These are the steps I do in the code.
1. I build the fieldcatalogue
2. then I select the data
3 . set the sort order
DATA: x_sort TYPE slis_sortinfo_alv.
x_sort-fieldname = 'SUPPLIER_ID'.
x_sort-tabname = 'GT_OUTTAB'.
x_sort-up = 'X'
x_sort-spos = 2.
APPEND x_sort TO t_sort.
4. Then I call the Reuse function.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
IS_LAYOUT = ls_layout
IT_FIELDCAT = t_fieldcat
i_callback_pf_status_set = l_status
i_callback_program = l_repid
it_sort = x_sort
T_OUTTAB = gt_outtab
PROGRAM_ERROR = 1
OTHERS = 2
But all the rows show the supplier ID, what am I doing wrong?
best regards B
Edited by: Baljinder Singh Gosal on Sep 29, 2008 2:36 PM
If so check this wiki contribution.