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

ALV Grouping

Former Member
0 Likes
443

hi guys I have a table

username | last login | user locked | Activity group

DALEX | 01.01.2007 | X | XYZ1

DALEX | 01.01.2007 | X | XYZ2

SHERB | 01.01.2007 | X | XYZ1

SHERB | 01.01.2007 | X | XYZ2

and i want to have it to be outputted into groups like this

DALEX | 01.01.2007 | X | XYZ1

*empty|empty|empty*| XYZ2

SHERB | 01.01.2007 | X | XYZ3

*empty|empty|empty*| XYZ4

I have tried sorting across multiple fields but it hides the 01.01.2007 for SHERB as it is the same data as DALEX.

Does anyone know of a way to only output data in an ALV grid that is different from the first row for each username?

3 REPLIES 3
Read only

Former Member
0 Likes
425
have you given like this

it_sort-fieldname = 'USERNAME'.
it_sort-spos = '1'.
it_sort-up = 'X'.
append it_sort.
Read only

0 Likes
425

Thanks but this is is not what I want.

If I do this it will group the usernames, but not remove the duplicate dates or anything else.

If I sort the dates aswell, all of the dates will be grouped and you will not be able to see the dates for different usernames

Read only

0 Likes
425

hi,

You can try in this way, but the report can not be sorted after we get the ALV output.

Populate the final internal table with spaces..

loop at <itab>.

abc | def | pqr |10

| | | 20

at new <f1>.

populate 4 fields

endat.

// clear first 3 fields

append final.

endloop.

Regards,

Sailaja.