- 第一步
DATA: LT_SORT_66 TYPE SLIS_T_SORTINFO_ALV.
- 第二步
DATA WA_LT_SORT TYPE SLIS_SORTINFO_ALV.
WA_LT_SORT-FIELDNAME = 'MATNR'.
WA_LT_SORT-UP = 'X'.
WA_LT_SORT-SUBTOT = 'X'.
APPEND WA_LT_SORT TO LT_SORT_66.
ENDFORM. " F_SORT_BULID
- 第三步
WA_FIELDCAT-SELTEXT_S = '数量'.
WA_FIELDCAT-SELTEXT_M = WA_FIELDCAT-SELTEXT_S.
WA_FIELDCAT-SELTEXT_L = WA_FIELDCAT-SELTEXT_S.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-DO_SUM = 'X'.
APPEND WA_FIELDCAT TO GT_FIELDCAT.
CLEAR WA_FIELDCAT.
- 第四步
EXPORTING
I_CALLBACK_PROGRAM = G_REPID_66_1
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = GT_FIELDCAT
IT_SORT = LT_SORT_66 " 再给一遍值