此问题已经解决
1.
系统信息
请用如下参数连接:
应用服务器:10.23.25.27
系统编号:
00
系统标识:
EMD
2.
RFC说明
Function Module: Z_WIFM0023
Import:
I_EBELN
TYPE
CHAR 10
I_MATNR
TYPE
CHAR
18
Export:
E_RETURN TYPE
I
E_ERRMSG TYPE
CHAR 480
TABLES :
T_EKPO STRUCTURE
EKPO
////////////////////////////////////////////////////////////////////////////////////
oleobject
saprfc,connection2,funct,table_d,functions,funct2,intab,categ
long
ll_status,result
saprfc = create oleobject
ll_status = saprfc.connecttonewobject("sap.functions")
//sap.functions
connection2 = saprfc.connection
connection2.applicationserver = "192.168.1.240"
//服务器IP
connection2.system = 'DD'
//系统标识
connection2.systemnumber = '00'
connection2.client = '120'
connection2.user = 'FR'
connection2.password = 'fr123'
connection2.language = 'en'
if connection2.logon(0,true) = false then
//登录
messagebox('connet sap','connect failed')
return
else
messagebox('connect sap','success')
end if
//调用Z_WIFM01
//funct = create oleobject
funct = saprfc.add("Z_WIFM01")
//convert oleobject in any variable to string
//funct.exports("I_EBELN",trim(sle_1.text))
//输入参数
//funct.exports("I_MATNR",trim(sle_2.text))
funct.exports("I_EBELN","qa110000428")
funct.exports("I_MATNR",'0000000028')
if funct.call = false then
//Call Rfc
messagebox('','Read bom call failed')
end if
//string ls_msg
//ls_msg = string(funct.Imports('E_ERRMSG'))
//messagebox('',ls_msg)
//funct.Imports("E_RETURN",rt)
//funct.Imports("E_ERRMSG",ls_msg)
intab = funct.tables("T_EKPO")
string ls_aa,ls_bb
Long ll_r
ll_r = intab.rowcount()
if ll_r > 0 then
ls_aa = intab.value(ll_r,'MATNR')
ls_bb = intab.value(ll_r,'WERKS')
end if
Messagebox(ls_aa,ls_bb)
////////////////////////////////////////////////////////////////////////////////////
[[it] 本帖最后由 freele_china 于 2008-9-24 13:31 编辑 [/it]]