‎2006 Nov 13 5:18 PM
Hi guys,
I need to sort a dynamic table (without header line) by a certain field in order to achieve the client requierment. I really don't have any clue about how can i do this, because, it appears that is not possible to declarate a field symbol type standar table with a headerline...
Regards,
Eric
‎2006 Nov 13 5:25 PM
‎2006 Nov 13 5:25 PM
‎2006 Nov 13 5:28 PM
Hi Max,
That's not possible because the table doesn't have a header line.
Regards,
Eric
‎2006 Nov 13 5:34 PM
Try this:
TABLES T001.
DATA: T_T001 LIKE STANDARD TABLE OF T001.
FIELD-SYMBOLS: <TABLE> TYPE TABLE.
DATA: FIELD1(30),
FIELD2(30),
FIELD3(30).
SELECT * FROM T001 INTO TABLE T_T001.
ASSIGN T_T001[] TO <TABLE>.
FIELD1 = 'BUTXT'.
SORT <TABLE> BY (FIELD1) (FIELD2) (FIELD3).
LOOP AT <TABLE> INTO T001.
WRITE: / T001-BUTXT, T001-BUKRS.
ENDLOOP.U have to decide how many fields can be used to sort the table: in my example I suppose the user can use max 3 fields in the same time.
The ALV use this way to sort the table.
Max
‎2006 Nov 13 7:34 PM