Skip to Content
Former Member
May 10, 2011 at 01:10 PM

Calling startrfc.exe from within a vbs script


Hello, can someone help me please

I am trying to process xml idocs into SAP on a Windows 2008 server. I have written a vbs script to process the file and am trying to call STARTRFC.EXE from within the vbs script. However I keep getting an error that it cannot open the file. The code is shown below. I have changed the server name and gateway and user/passwd for security. I'm passing the filename as a variable (str_expfile) but it does not seem to be able to extract the actual file name from the variable. I know from past experience that you can pass it variables if its running on a unix box and in a shell. But for some reason it not decipering the variable name in the vbs script

Set objShell = CreateObject("Wscript.Shell")

str_startrfc = "D:\usr\sap\SID\SYS\exe\uc\NTAMD64\startrfc.exe -d SID -3 -h hostname -s 00 -g hostname -x sapgw00 -u user -p passwd -c 100 -l EN -t -F EDI_DATA_INCOMING -E PORT=MYPORT -E PATHNAME=str_expfile"

objShell.Run str_startrfc, ,True

The error I'm getting is shown below:

  • ERROR file opened at 20110510 134219 GMT Daylight Time, SAP-REL 700,0,278 RFC-VER 3 1200864 MT-SL

T:2584 Error in program 'startrfc': ======> Error at OPEN 'str_expfile' (check file)

T:2584 Error in program 'startrfc': <* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION

T:2584 Error in program 'startrfc': <* RfcCallReceive [1] : returns 3:RFC_SYS_EXCEPTION