怎么设计ABAP的表头
3个回答
展开全部
*ALV LIST 定义
DATA: L_FIELDCAT TYPE SLIS_FIELDCAT_ALV,*一列描述
G_FIELDCAT_ALV TYPE SLIS_T_FIELDCAT_ALV,*列描述内表,列清单
FORM FRM_SET_COLUMNS . "设置表头
DATA: L_POS TYPE I VALUE 0.
REFRESH G_FIELDCAT_ALV.
CLEAR L_FIELDCAT.
L_POS = 0.
L_FIELDCAT-COL_POS = L_POS.
L_FIELDCAT-FIELDNAME = 'RSNUM'.
L_FIELDCAT-SELTEXT_L = TEXT-001.
APPEND L_FIELDCAT TO G_FIELDCAT_ALV.
CLEAR L_FIELDCAT.
L_POS = L_POS + 1.
L_FIELDCAT-COL_POS = L_POS.
L_FIELDCAT-FIELDNAME = 'BDTER'.
L_FIELDCAT-SELTEXT_L = TEXT-002.
APPEND L_FIELDCAT TO G_FIELDCAT_ALV.
ENDFORM.
*接着显示ALV的函数
FORM FRM_ALV_DISPLAY_DATA . "4、显示ALV界面
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = 'FRM_STATUS_ALV'
I_CALLBACK_USER_COMMAND = 'FRM_USER_COMMAND_ALV'
IS_LAYOUT = G_LAYOUT
IT_FIELDCAT = G_FIELDCAT_ALV[]
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " FRM_ALV_DISPLAY_DATA
DATA: L_FIELDCAT TYPE SLIS_FIELDCAT_ALV,*一列描述
G_FIELDCAT_ALV TYPE SLIS_T_FIELDCAT_ALV,*列描述内表,列清单
FORM FRM_SET_COLUMNS . "设置表头
DATA: L_POS TYPE I VALUE 0.
REFRESH G_FIELDCAT_ALV.
CLEAR L_FIELDCAT.
L_POS = 0.
L_FIELDCAT-COL_POS = L_POS.
L_FIELDCAT-FIELDNAME = 'RSNUM'.
L_FIELDCAT-SELTEXT_L = TEXT-001.
APPEND L_FIELDCAT TO G_FIELDCAT_ALV.
CLEAR L_FIELDCAT.
L_POS = L_POS + 1.
L_FIELDCAT-COL_POS = L_POS.
L_FIELDCAT-FIELDNAME = 'BDTER'.
L_FIELDCAT-SELTEXT_L = TEXT-002.
APPEND L_FIELDCAT TO G_FIELDCAT_ALV.
ENDFORM.
*接着显示ALV的函数
FORM FRM_ALV_DISPLAY_DATA . "4、显示ALV界面
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = 'FRM_STATUS_ALV'
I_CALLBACK_USER_COMMAND = 'FRM_USER_COMMAND_ALV'
IS_LAYOUT = G_LAYOUT
IT_FIELDCAT = G_FIELDCAT_ALV[]
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " FRM_ALV_DISPLAY_DATA
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
手动设置最好
*根据结构体获取
FORM CATALOG.
data: wlt_fieldcat like line of FIELDCAT.
clear wlt_fieldcat.
wlt_fieldcat-fieldname = 'VBELN'.
* wlt_fieldcat-tabname = 'DETAILS'.
* wlt_fieldcat-no_out = ' '.
* wlt_fieldcat-key = 'X'.
wlt_fieldcat-seltext_l = '报价单号'.
append wlt_fieldcat to FIELDCAT.
ENDFORM.
*根据结构体获取
FORM CATALOG.
data: wlt_fieldcat like line of FIELDCAT.
clear wlt_fieldcat.
wlt_fieldcat-fieldname = 'VBELN'.
* wlt_fieldcat-tabname = 'DETAILS'.
* wlt_fieldcat-no_out = ' '.
* wlt_fieldcat-key = 'X'.
wlt_fieldcat-seltext_l = '报价单号'.
append wlt_fieldcat to FIELDCAT.
ENDFORM.
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
如果用ALV来开发报表,就不需要设计表头了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询