引用:翱翔云天
ALSM_EXCEL_TO_INTERNAL_TABLE
这个函数用来取excel文件中制定的某一个cell的值比较有用,不过要注意excel文件不要太大,不然速度会比较慢。
下面是例子程序:
REPORT ZTESTXU .
* Define corresponding internal table
data: itab like ALSMEX_TABLINE occurs 0 with header line.
* Call the function
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = 'd:\1.xls'
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
.
*Write result to list
IF SY-SUBRC = 0.
loop at itab.
write: / itab-row,itab-col,itab-value.
endloop.
ENDIF.