FIELD-SYMBOLS : <f1>,<f> .
DATA: wa TYPE cxtab_column.
DATA: icount TYPE i .
DATA: f1(10) ,f2(10) .
LOOP AT tc_9001-cols INTO wa.
IF wa-selected = 'X' .
ADD 1 TO icount .
SPLIT wa-screen-name AT '-' INTO f1 f2 .
IF okcode = 'USORT' .
SORT t_itab BY (f2) ASCENDING .
ELSE .
SORT t_itab BY (f2) DESCENDING .
ENDIF .
ENDIF.
ENDLOOP .
IF icount = 0 .
MESSAGE i208(00) WITH '请选中需要排序的列'.
ENDIF .
DATA: wa TYPE cxtab_column.
DATA: icount TYPE i .
DATA: f1(10) ,f2(10) .
LOOP AT tc_9001-cols INTO wa.
IF wa-selected = 'X' .
ADD 1 TO icount .
SPLIT wa-screen-name AT '-' INTO f1 f2 .
IF okcode = 'USORT' .
SORT t_itab BY (f2) ASCENDING .
ELSE .
SORT t_itab BY (f2) DESCENDING .
ENDIF .
ENDIF.
ENDLOOP .
IF icount = 0 .
MESSAGE i208(00) WITH '请选中需要排序的列'.
ENDIF .