report ytest67.
data : begin of iexcel occurs 0 .
include structure alsmex_tabline .
data: end of iexcel .
parameters: fn1 like rlgrap-filename memory id m01.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = fn1
i_begin_col = 1
i_begin_row = 1
i_end_col = 100
i_end_row = 1000
tables
intern = iexcel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
if sy-subrc <> 0.
write :/'读入文件错误', fn1 .
else .
loop at iexcel .
write iexcel-value(20).
at end of row .
write: / .
endat.
endloop.
endif.
要注意excel必须是标准MS格式的,否则不能识别,从而系统报错。