[출처 : https://sapjoy.co.kr/ ]
DATA : SORT_FIELD(30),
LS_COLS TYPE CXTAB_COLUMN.
WHEN 'ASC' OR 'DES'.
READ TABLE TC1-COLS INTO LS_COLS WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
MOVE LS_COLS-SCREEN-NAME+8(20) TO SORT_FIELD.
CASE SAVE_OK.
WHEN 'ASC'.
SORT IT_301_S BY (SORT_FIELD) ASCENDING.
when 'DESC'.
SORT IT_301_S BY (SORT_FIELD) DESCENDING.
ENDCASE.
ELSE.
MESSAGE I001 WITH 'Select the field you want to sort on.!'.
ENDIF.
댓글 없음:
댓글 쓰기