2005 Aug 02 10:06 PM
Using REUSE_ALV_GRID_DISPLAY, I want to hide a key column value when duplicate in rows(see below):
Customer Product
1 1000
1 1001
1 1002
would show in grid as
1 1000
1001
1002
I can't remember where the setting is for this. Anyone?
2005 Aug 03 7:31 AM
Hi Rayland,
You can sort the corresponding key value and pass the itab to the Function module.Can refer the following eg.,
DATA wa_sort TYPE lvc_s_sort .
Customer ID
wa_sort-spos = '1' .
wa_sort-fieldname = 'custid' .
wa_sort-up = 'X' . "A to Z
wa_sort-down = ' ' .
APPEND wa_sort TO it_sort_tab .
CALL METHOD o_alvgrid->set_table_for_first_display
EXPORTING
is_variant = wa_variant
i_save = 'A'
i_default = 'X'
CHANGING
it_outtab = it_outtab[]
it_fieldcatalog = it_fieldcat
it_sort = it_sort_tab
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
Happy Working,
Kiruthika.
2005 Aug 02 10:42 PM
Hi
you goto Layout change and display tab, remove the (uncheck) "without cell meging during sorts" option and sort the data by Customer.
Thanks
balu
2005 Aug 03 7:31 AM
Hi Rayland,
You can sort the corresponding key value and pass the itab to the Function module.Can refer the following eg.,
DATA wa_sort TYPE lvc_s_sort .
Customer ID
wa_sort-spos = '1' .
wa_sort-fieldname = 'custid' .
wa_sort-up = 'X' . "A to Z
wa_sort-down = ' ' .
APPEND wa_sort TO it_sort_tab .
CALL METHOD o_alvgrid->set_table_for_first_display
EXPORTING
is_variant = wa_variant
i_save = 'A'
i_default = 'X'
CHANGING
it_outtab = it_outtab[]
it_fieldcatalog = it_fieldcat
it_sort = it_sort_tab
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
Happy Working,
Kiruthika.