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

SORT-ALV

former_member329386
Participant
0 Likes
379

HI SAP

I WANT TO SORT FIRST 4 FIELDS IN ALV USING MACROS . I PASSED SORT[] TO 'REUSE_ALV_GRID_DISPLAY'.

BUT ONLY 2 FIELDS ARE SORTED. CAN U CHECK THIS MACRO STATEMENT.

DEFINE MACROS1.

SORT-SPOS = &1.

SORT-FIELDNAME = &2.

SORT-TABNAME = 'TT_ITAB'.

SORT-UP = 'X'.

APPEND SORT.

CLEAR SORT.

END-OF-DEFINITION.

MACROS1 '1' 'EBELN'.

MACROS1 '2' 'AEDAT'.

MACROS1 '3' 'LIFNR'.

MACROS1 '4' 'EKGRP'.

THANKS.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
360

Hi

The macro is fine. If it has worked for 2 fields, then it should work for other 2. Just check if the field names are the same in the internal table.

Regards

Navneet

HI SAP

I WANT TO SORT FIRST 4 FIELDS IN ALV USING MACROS . I PASSED SORT[] TO 'REUSE_ALV_GRID_DISPLAY'.

BUT ONLY 2 FIELDS ARE SORTED. CAN U CHECK THIS MACRO STATEMENT.

DEFINE MACROS1.

SORT-SPOS = &1.

SORT-FIELDNAME = &2.

SORT-TABNAME = 'TT_ITAB'.

SORT-UP = 'X'.

APPEND SORT.

CLEAR SORT.

END-OF-DEFINITION.

MACROS1 '1' 'EBELN'.

MACROS1 '2' 'AEDAT'.

MACROS1 '3' 'LIFNR'.

MACROS1 '4' 'EKGRP'.

THANKS.

1 REPLY 1
Read only

Former Member
0 Likes
361

Hi

The macro is fine. If it has worked for 2 fields, then it should work for other 2. Just check if the field names are the same in the internal table.

Regards

Navneet