Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

REUSE_ALV_GRID_DISPLAY - Hiding duplicate key values

Former Member
0 Kudos

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?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

2 REPLIES 2

Former Member
0 Kudos

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

Former Member
0 Kudos

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.