OLEObject I_OLE_ExcelServer
long ll_col , ll_cols , ll_row , ll_rows
string ls_filename
long i,j
string ls_data
long ll_ret_row //返回当前导出的数据行数
fxn = i_ole_fxnctrl.add(as_export_table)//给接口函数输入参数赋值
fxn.Exports('MATNR').value = ‘00000000100000001’ //传入参数
if fxn.call then //调用SAP的RFC函数
kehu = FXN.tables
ll_rows = kehu.item(1).rowcount //取得行数
ll_cols = kehu.item(1).Columncount //取列数
if ll_rows <=0 then return ll_ret_row
//将RFC返回的数据写到文件上
integer li_FileNum
//打开临时文件
li_FileNum = FileOpen(ls_filename, LineMode!, Write!, LockWrite!, Append!)
//循环写入临时文件
for i = 1 to ll_rows step 1
ls_data = string(kehu.item(1).value(i,1))
for j = 2 to ll_cols step 1
ls