Skip to Content
0
Former Member
Jun 12, 2013 at 09:07 AM

Sorting in ALV with multiple fields

256 Views

Hi All,

I have a requirement to sort an ALV grid and get the unique combination of keys.

for me output is coming like this i am using below coding.

AUFNR SERNR EQUNR banfn bnfpo ebeln ebelp LBLNI

Order Serial No Equipment No Purchase Reg Item Purchasing Doc Item Service Entry Service Da 4070408 14 M-CS-JUTO-BCM 1500015 10 101515 10

15 M-CS-LTO-BCM
10
10


40 M-FS-SBM1000
10
10 1000031274 12.04.2013



20
20 1000031275 12.04.2013

SORT it_all BY aufnr banfn bnfpo ebeln ebelp.

wa_sort-fieldname = 'AUFNR'.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

*_Begin of modification mathumitha.T 10.06.2013

wa_sort-fieldname = 'BANFN'.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'BNFPO'.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'EBELN'.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'EBELP'.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'LBLNI'.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

BUt i want like this .........

AUFNR SERNR EQUNR banfn bnfpo ebeln ebelp LBLNI

Order Serial No Equipment No Purchase Reg Item Purchasing Doc Item Service Entry Service Da 4070408 14 M-CS-JUTO-BCM 1500015 10 101515 10 1000031274 12.04.2013
15 M-CS-LTO-BCM
10
10


40 M-FS-SBM1000
10
10





20
20 1000031275 12.04.2013