<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: RfcRegisterServer exited with error in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321460#M4366</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have even tried to build my version of rfcexec from existing source code and the error is the same, regardless to the fact that the use of "rfcexec.exe" from NW RFC SDK is correct.&lt;/P&gt;</description>
    <pubDate>Sun, 06 Nov 2016 10:37:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-11-06T10:37:05Z</dc:date>
    <item>
      <title>RfcRegisterServer exited with error</title>
      <link>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaq-p/321457</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
  &lt;P&gt;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:&lt;/P&gt;
  &lt;P&gt;DEST=TestRFC&lt;BR /&gt;TYPE=R&lt;BR /&gt;GWSERV=3300&lt;BR /&gt;GWHOST=192.168.3.73&lt;/P&gt;
  &lt;P&gt;PROGRAM_ID=TestRFCSERVERID&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;In my source code I have prepared structure RFC_CONNECTION_PARAMETER in the following maner:&lt;/P&gt;
  &lt;P&gt;RFC_CONNECTION_PARAMETER m_oGatewayParams[1];&lt;/P&gt;
  &lt;P&gt;m_oGatewayParams[0].name = cU("DEST");&lt;/P&gt;
  &lt;P&gt;m_oGatewayParams[0].value = cU("TestRFC");&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;After that I call RfcRegisterServer function:&lt;/P&gt;
  &lt;P&gt;m_hRFCConn = ::RfcRegisterServer(m_oGatewayParams,1,&amp;amp;Err);&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;When I debug my application and reach the line with &lt;/P&gt;
  &lt;P&gt;RfcRegisterServer, the result of its execution is the error with the following description:&lt;/P&gt;
  &lt;P&gt;RFC_INVALID_PARAMETER&lt;/P&gt;
  &lt;P&gt;Parameter ASHOST, GWHOST or MSHOST is missing.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;How can I fix this error?&lt;BR /&gt;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:&lt;/P&gt;
  &lt;P&gt;rfcexec -a TestRFCSERVERID -g 192.168.3.73 -x 3300&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 14:37:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaq-p/321457</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-03T14:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: RfcRegisterServer exited with error</title>
      <link>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321458#M4364</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Can you please provide the complete sample code?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaías&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 19:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321458#M4364</guid>
      <dc:creator>Isaias_SAP</dc:creator>
      <dc:date>2016-11-03T19:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: RfcRegisterServer exited with error</title>
      <link>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321459#M4365</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;RFC_CONNECTION_PARAMETERm_oGatewayParams[1];&lt;BR /&gt;RFC_ERROR_INFO Err;&lt;BR /&gt;m_oGatewayParams[0].name = cU("DEST");&lt;BR /&gt;m_oGatewayParams[0].value = cU("TestRFC");&lt;BR /&gt;RFC_CONNECTION_HANDLE m_hRFCConn = RfcRegisterServer(m_oGatewayParams,1,&amp;amp;Err);&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 10:34:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321459#M4365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-06T10:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: RfcRegisterServer exited with error</title>
      <link>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321460#M4366</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have even tried to build my version of rfcexec from existing source code and the error is the same, regardless to the fact that the use of "rfcexec.exe" from NW RFC SDK is correct.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 10:37:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321460#M4366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-06T10:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: RfcRegisterServer exited with error</title>
      <link>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321461#M4367</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;To me it worked. I could see my program registered at the transaction SMGW -&amp;gt; goto -&amp;gt; logged on clients.&lt;BR /&gt;&lt;BR /&gt;Here is the complete code of my program:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#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,&amp;amp;Err);
    if (m_hRFCConn == NULL) {
        printf("Error when opening an RFC connection!");
        RfcCloseConnection(m_hRFCConn, &amp;amp;Err);
        return 1;
    }
    
    //sleep 5s so I can see the program registered at SMGW
    sleep(5);
    printf("It worked.");
    RfcCloseConnection(m_hRFCConn, &amp;amp;Err);

    return 0;
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And here the contents of my "sapnwrfc.ini" file:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DEST=TestRFC
TYPE=R
GWSERV=3330
GWHOST=&amp;lt;IP of my VM&amp;gt;
PROGRAM_ID=TestRFCSERVERID
&amp;lt;blank line at the end&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I did differently:&lt;BR /&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I first just declared the handle (RFC_CONNECTION_HANDLE m_hRFCConn;);&lt;/LI&gt;&lt;LI&gt;I called the function "RfcRegisterServer()" only after RfcInit();&lt;/LI&gt;&lt;LI&gt;I removed a blank line between "GWHOST" and "PROGRAM_ID" at the "ini" file;&lt;/LI&gt;&lt;LI&gt;My "ini" file has a blank line at the end.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;I hope this helps.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Isaías&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 20:32:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321461#M4367</guid>
      <dc:creator>Isaias_SAP</dc:creator>
      <dc:date>2016-11-09T20:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: RfcRegisterServer exited with error</title>
      <link>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321462#M4368</link>
      <description>&lt;P&gt;OK, calling RfcInit() is not required, actually.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 11:57:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321462#M4368</guid>
      <dc:creator>Isaias_SAP</dc:creator>
      <dc:date>2016-11-10T11:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: RfcRegisterServer exited with error</title>
      <link>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321463#M4369</link>
      <description>&lt;P&gt;PS: about the tags you used at this question, please change it to "ABAP Connectivity". Only now I have realized that you used the CST tag &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 19:54:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rfcregisterserver-exited-with-error/qaa-p/321463#M4369</guid>
      <dc:creator>Isaias_SAP</dc:creator>
      <dc:date>2016-11-10T19:54:01Z</dc:date>
    </item>
  </channel>
</rss>

