这种是HTML方法,很容易操作的一种方法
1、在ALV方法中调用 TOP_OF_PAGE这个FORM。
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING I_CALLBACK_PROGRAM = SY-REPID IS_LAYOUT = G_LAYOUT IT_FIELDCAT = IT_FIELDCAT I_CALLBACK_USER_COMMAND = 'ALV_USE_COMMAND' I_CALLBACK_HTML_TOP_OF_PAGE = 'F_TOP_OF_PAGE' I_SAVE = 'A' * IT_EVENTS = IT_EVENT[] TABLES T_OUTTAB = IT_DATA 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 F_TOP_OF_PAGE USING P_CL_DD TYPE REF TO CL_DD_DOCUMENT. DATA: M_P TYPE I, M_BUFFER TYPE STRING. M_BUFFER = '<HTML><CENTER><H2>客户信用额度管控月度报表</H2></CENTER><HTML>'. CALL METHOD P_CL_DD->HTML_INSERT EXPORTING CONTENTS = M_BUFFER CHANGING POSITION = M_P. CONCATENATE '查询日期:' P_BUDAT ' 单位:元 ' INTO M_BUFFER. CALL METHOD P_CL_DD->HTML_INSERT EXPORTING CONTENTS = M_BUFFER CHANGING POSITION = M_P. ENDFORM.