写了一个简单的例子,显示为排版。以下内容为程序代码:DATA: itab LIKE STANDARD TABLE OF alsmex_tabline, wtab LIKE alsmex_tabline.PARAMETERS fname LIKE rlgrap-filename MEMORY ID m01.AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname. CALL FUNCTION 'KD_GET_FILENAME_ON_F4' EXPORTING mask = '*.xls' static = 'X' CHANGING file_name = fname.START-OF-SELECTION. CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' EXPORTING filename = fname i_begin_col = 1 i_begin_row = 1 i_end_col = 10 i_end_row = 10 TABLES intern = itab EXCEPTIONS inconsistent_parameters = 1 upload_ole = 2 OTHERS = 3. SORT itab BY row col. LOOP AT itab INTO wtab. AT NEW row. WRITE: space, /. ENDAT. WRITE: wtab-value. ENDLOOP.
ALSM_EXCEL_TO_INTERNAL_TABLE 用这个FUNTION 需要预先定义想要读取的EXCEL文件表的范围,以起始和终止行,列号定义 读入的数据是按行号和列号排列