Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Alv Sort and Grouping

Hello Friends,

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

xxx xxx

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.

CLEAR x_sort.

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'

EXPORTING

IS_LAYOUT = ls_layout

IT_FIELDCAT = t_fieldcat

i_callback_pf_status_set = l_status

i_callback_program = l_repid

it_sort = x_sort

TABLES

T_OUTTAB = gt_outtab

EXCEPTIONS

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

Tags:
Former Member
Former Member replied

If so check this wiki contribution.

https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-ALVReportGroupFunctionalitywithCheckbox

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question