Application Development and Automation 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: 
Read only

ALG Grid Same values not grouped!

Former Member
0 Likes
606

I have an alv grid

For example I sort by a column personal number. and the same personal number appears several times...

The personal number is displayed on each line! Normally it should display the personal number on the first line and the other lines should be blank...

What should i do ? Did i give invalid data to the layout!

Regards,

S

4 REPLIES 4
Read only

Former Member
0 Likes
563

havu u used it_sort-up = 'X'.

chk this for further info

http://www.geocities.com/mpioud/Z_DEMO_ALV_SORT.html

Read only

Former Member
0 Likes
563

Stephan,

Just make sure that in the layout NO_MERGING is not set to 'X'.

Regards,

Ravi

Note : Please reward the posts that help you.

Read only

Former Member
0 Likes
563

Make the personal number field in the sort table just

like below :

  • Refresh

REFRESH gt_sort_stat.

  • Document Number

CLEAR gt_sort_stat.

gt_sort_stat-spos = 1.

gt_sort_stat-fieldname = 'DOCNUM'. " Give personal num.

gt_sort_stat-up = gc_mark.

APPEND gt_sort_stat.

  • Method to display the alv grid !!

CALL METHOD gv_grid_sta->set_table_for_first_display

EXPORTING

i_save = gv_save

is_layout = gv_layout

is_print = gv_print

is_variant = gv_variant

CHANGING

it_sort = gt_sort_stat[]

it_fieldcatalog = gt_fieldcat_sta[]

it_outtab = gt_idoc_stat[].

Then your problem will be solved.

Read only

0 Likes
563

Guys,

This grouping is a standard functionality of alv, Except ** layout have to contain exception field

    lw_layout-excp_fname = 'EXCEPTION'.
    lw_layout-cwidth_opt = 'X'.
*    lw_layout-zebra = 'X'.
    lw_layout-info_fname = 'LINE_COLOR'.

I didn't do anything! So for me sorting as you advice is maybe working but I shouldn't do this!!