Skip to Content
0
Jul 18, 2008 at 05:48 PM

sort itab

26 Views

I need to do the following sort:

SORT it_header BY lifnr xblnr belnr ASCENDING.

Only I also want it sorted by CHECF descending. Basically, I need it to be ascending except I want all records, with a blank CHECF, last (within it's own vendor, lifnr, section).

Example:

LIFNR XBLNR BELNR CHECF

00001 001000 000100

00002 012000 000111

00002 012340 012300 000034

00001 001100 000110 000001

Would be, after all sorts:

LIFNR XBLNR BELNR CHECF

00001 001100 000100 000001

00001 001000 000100

00002 012340 012300 000034

00002 012000 000111 "If no CHECF then it should be the last entry for the vendor, no matter the other fields.

Is there a way to do this without looping through the table?