代码
Set ofun = CreateObject("SAP.Functions")
Set ologonctrl=createobject("SAP.Logoncontrol.1")
Set ofun.connection=ologonctrl.newconnection
ofun.connection.system = sap_System
ofun.connection.systemnumber = sap_SystemNo
ofun.connection.applicationserver = sap_appserver
ofun.connection.user = sap_user
ofun.connection.Password = sap_pw
ofun.connection.Client = sap_client
ofun.connection.Language = sap_lan
ofun.connection.CodePage = "8400"’如果中文乱码请加上这个语句
Call ofun.connection.logon(0,True)
REM set import data parameters needed in SAP
Set oPO = ofun.Add("ZRFC_CUSTOMER_BLOCK_UNBLOCK")’调用的Function
Set otablepo = opo.Tables("CUSTBLK")’输入的表
otablepo.rows.add
larr(1)=pdoc.SAPNumber(0) 'Customer SAP Number
larr(2)="X" 'Block Flag
For i =1 To 2
otablepo.value(1,i)=larr(i)
Next
oPo.call