Skip to Content
0
Former Member
Aug 30, 2007 at 12:54 PM

Sort in ALV

19 Views

Hi All,

I am writing the logic for sort,Here I am writing on data, actuall i want that.

Please find the below code. At sort stmt i am getting the dump. please help me in this.

LOOP AT IT_ALV_DATA FROM W_LOOP_FROM_EU TO W_LOOP_TO_EU.

LW_TABIX = SY-TABIX.

READ TABLE IT_FIELDCAT INTO LW_FIELDCAT WITH KEY

FIELDNAME = LIT_DBSORTINFO-KEY1.

IF SY-SUBRC = 0.

ASSIGN COMPONENT SY-TABIX OF

STRUCTURE IT_ALV_DATA TO <LFS>.

IF SY-SUBRC = 0.

CLEAR LW_CHAR.

LW_CHAR = <LFS>.

IF LW_DOWN = 'X'.

SORT IT_ALV_DATA BY (LW_CHAR) DESCENDING .

ELSEIF LW_UP = 'X'.

SORT IT_ALV_DATA BY (LW_CHAR) ASCENDING .

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

regards,

Ajay reddy