on 11-03-2016 2:37 PM
Hi!
My problem is as follows. I am using NW RFC SDK 64bit to create my own RFC Server application. I have installed SAP ABAP Trial 7.03 for testing and have created destination with name "TestRFC" which uses TCP/IP Connection. in my sapnwrfc.ini file I have saved the following text:
DEST=TestRFC
TYPE=R
GWSERV=3300
GWHOST=192.168.3.73
PROGRAM_ID=TestRFCSERVERID
In my source code I have prepared structure RFC_CONNECTION_PARAMETER in the following maner:
RFC_CONNECTION_PARAMETER m_oGatewayParams[1];
m_oGatewayParams[0].name = cU("DEST");
m_oGatewayParams[0].value = cU("TestRFC");
After that I call RfcRegisterServer function:
m_hRFCConn = ::RfcRegisterServer(m_oGatewayParams,1,&Err);
When I debug my application and reach the line with
RfcRegisterServer, the result of its execution is the error with the following description:
RFC_INVALID_PARAMETER
Parameter ASHOST, GWHOST or MSHOST is missing.
How can I fix this error?
P.S. I am using Visual Studio 2010 in Windows7 x64, SAP gateway is launched in virtual machine with IP-address 192.168.3.73, which is available. Moreover, I succeded to register my server using rfcexec.exe tool with the following command line:
rfcexec -a TestRFCSERVERID -g 192.168.3.73 -x 3300
Hello,
To me it worked. I could see my program registered at the transaction SMGW -> goto -> logged on clients.
Here is the complete code of my program:
#include <stdio.h>
#include <unistd.h>
#include "c:\path\to\rfc\nwrfcsdk\include\sapnwrfc.h"
int main(int argc, SAP_UC** argv) {
RFC_CONNECTION_PARAMETER m_oGatewayParams[1];
RFC_ERROR_INFO Err;
m_oGatewayParams[0].name = cU("DEST");
m_oGatewayParams[0].value = cU("TestRFC");
RFC_CONNECTION_HANDLE m_hRFCConn;
RfcInit();
m_hRFCConn = RfcRegisterServer(m_oGatewayParams,1,&Err);
if (m_hRFCConn == NULL) {
printf("Error when opening an RFC connection!");
RfcCloseConnection(m_hRFCConn, &Err);
return 1;
}
//sleep 5s so I can see the program registered at SMGW
sleep(5);
printf("It worked.");
RfcCloseConnection(m_hRFCConn, &Err);
return 0;
}
And here the contents of my "sapnwrfc.ini" file:
DEST=TestRFC
TYPE=R
GWSERV=3330
GWHOST=<IP of my VM>
PROGRAM_ID=TestRFCSERVERID
<blank line at the end>
What I did differently:
I hope this helps.
Best regards,
Isaías
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Can you please provide the complete sample code?
Regards,
Isaías
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.