ABAP中,alv的第一列加了checkbox,选中后,为何内表的此列的值不会更新?
TYPES:BEGINOFTY_ALV,MARKTYPEC,BUKRSLIKEBKPF-BUKRS,ENDOFTY_ALV.DATA:WA_ALVTYPETY_ALV,I...
TYPES : BEGIN OF TY_ALV,
MARK TYPE C ,
BUKRS LIKE BKPF-BUKRS,
END OF TY_ALV.
DATA: WA_ALV TYPE TY_ALV,
IT_ALV TYPE STANDARD TABLE OF TY_ALV WITH HEADER LINE.
FORM FRM_LAYOUT .
LAYOUT-NO_INPUT = ' '.
LAYOUT-BOX_FIELDNAME = 'MARK'.
LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'SET_USER_COMMAND'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDCAT[]
IT_EVENTS = GT_EVENTS[]
I_SAVE = 'X'
TABLES
T_OUTTAB = IT_ALV
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM FRM_FIELDCAT .
FIELDCAT-COL_POS = 1.
FIELDCAT-FIELDNAME = 'MARK'.
FIELDCAT-SELTEXT_M = 'FLAG'.
FIELDCAT-CHECKBOX = 'X' .
FIELDCAT-EDIT = 'X ' .
APPEND FIELDCAT TO FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-COL_POS = 2.
FIELDCAT-FIELDNAME = 'BUKRS'.
FIELDCAT-SELTEXT_M = '公司代码'.
APPEND FIELDCAT TO FIELDCAT.
CLEAR FIELDCAT.
ENDFORM. 展开
MARK TYPE C ,
BUKRS LIKE BKPF-BUKRS,
END OF TY_ALV.
DATA: WA_ALV TYPE TY_ALV,
IT_ALV TYPE STANDARD TABLE OF TY_ALV WITH HEADER LINE.
FORM FRM_LAYOUT .
LAYOUT-NO_INPUT = ' '.
LAYOUT-BOX_FIELDNAME = 'MARK'.
LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'SET_USER_COMMAND'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDCAT[]
IT_EVENTS = GT_EVENTS[]
I_SAVE = 'X'
TABLES
T_OUTTAB = IT_ALV
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM FRM_FIELDCAT .
FIELDCAT-COL_POS = 1.
FIELDCAT-FIELDNAME = 'MARK'.
FIELDCAT-SELTEXT_M = 'FLAG'.
FIELDCAT-CHECKBOX = 'X' .
FIELDCAT-EDIT = 'X ' .
APPEND FIELDCAT TO FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-COL_POS = 2.
FIELDCAT-FIELDNAME = 'BUKRS'.
FIELDCAT-SELTEXT_M = '公司代码'.
APPEND FIELDCAT TO FIELDCAT.
CLEAR FIELDCAT.
ENDFORM. 展开
3个回答
展开全部
你要刷新ALV显示,调用ALV类中的刷新方法
call method cl_alv->refresh_table_display
exporting
is_stable = gs_refresh
i_soft_refresh = ''.
data: begin of gs_refresh,"ALV刷新结构
row type char01 value 'X',
col type char01 value 'X',
end of gs_refresh.
call method cl_alv->refresh_table_display
exporting
is_stable = gs_refresh
i_soft_refresh = ''.
data: begin of gs_refresh,"ALV刷新结构
row type char01 value 'X',
col type char01 value 'X',
end of gs_refresh.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
SET_USER_COMMAND的代码呢?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = LC_GRID.
试试这个function.
IMPORTING
E_GRID = LC_GRID.
试试这个function.
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询