<?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: Java RFC Connection: Step by step in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946110#M2839442</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2011 10:16:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-07T10:16:42Z</dc:date>
    <item>
      <title>Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaq-p/7946108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my first goal is to achieve a remote function call from Java to SAP or the other way.&lt;/P&gt;&lt;P&gt;My first attempt is a Java application which does a RFC to a SAP ABAP function that returns me some database data, but more about that later.&lt;/P&gt;&lt;P&gt;The first thing where i already fail is to build up a simple connection between Java and SAP.&lt;/P&gt;&lt;P&gt;I tried it with JCo v2.1.x and JCo v3.x (Which version should i prefer? are there advantages, disadvantages?)&lt;/P&gt;&lt;P&gt;Here are the two approaches:&lt;/P&gt;&lt;P&gt;{JCO v2.1.x}:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;		
JCO.Client myConnection = JCO.createClient("001",
												   "***", 
												   "****", 
												   "DE", 
												   "***", 
												   "00");
myConnection.connect();
...
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a "(103) RFC_ERROR_LOGON_FAILURE: Userid or password incorrect". I put in my normal SAP GUI account. Its not an admin account but i can create reports etc in the ABAP Editor.&lt;/P&gt;&lt;P&gt;I checked the spelling several time and it should be ok. Why does it say incorrect user or password?&lt;/P&gt;&lt;P&gt;Is this possible because of insufficient rights?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{JCo v3.x}:&lt;/P&gt;&lt;P&gt;I just tried the "StepByStepClient" example included in the sapjco3 download and i saw that every connect function begins with a "JCoDestination destination = JCoDestinationManager.getDestination(String);" line.&lt;/P&gt;&lt;P&gt;But what exactly does this getDestination function do? What string do i pass there? In the example is it JCoDestinationManager.getDestination("ABAP_AS_WITHOUT_POOL"); but then i get the error: ""(106) JCO_ERROR_RESOURCE: Destination ABAP_AS_WITHOUT_POOL could not be created:"..&lt;/P&gt;&lt;P&gt;Can anyone explain me how this works?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 09:00:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaq-p/7946108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-07T09:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946109#M2839441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well as far as calling a RFC from java is concerned....below is code that worked fine for me.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;JCO.Client connClient = null;
        IRepository mRepository;
	connClient = JCO.createClient("&amp;lt;SAP Client&amp;gt;","&amp;lt;UserId&amp;gt;","&amp;lt;Password&amp;gt;","EN","&amp;lt;Application server host name&amp;gt;","&amp;lt;system number&amp;gt;");
        try {
	connClient.connect();
	} catch (Exception ex)
	{
		ex.printStackTrace();
		System.exit(1);
	}
	mRepository = new JCO.Repository("Hell", connClient);
	JCO.Function strHELLO = mRepository.getFunctionTemplate("ZSAU_FM_ASSIGNMENT").getFunction();
	JCO.ParameterList importParam = strHELLO.getImportParameterList();
	importParam.setValue(val,"ZMATNR");
	try {
		connClient.execute(strHELLO);
	}catch (JCO.AbapException ex)
			{
			}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you have followed procedure mentioned under:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/47/80f671ee6e4b41b63c0fe46bd6e4f8/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/47/80f671ee6e4b41b63c0fe46bd6e4f8/content.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 10:13:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946109#M2839441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-07T10:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946110#M2839442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 10:16:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946110#M2839442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-07T10:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946111#M2839443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok thanks alot!&lt;/P&gt;&lt;P&gt;It works fine now. But is there any reason to use an older version of JCo (eg v2.1.x ?)&lt;/P&gt;&lt;P&gt;If not im gonna use the newest version since they work both now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 08:01:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946111#M2839443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-08T08:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946112#M2839444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ahhhh...if they both work.....they why to use an older version....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use 3.0....&lt;/P&gt;&lt;P&gt;good for you that they worked....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 08:23:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946112#M2839444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-08T08:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946113#M2839445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you already know my connection works now, but there are two more little questions that came up:&lt;/P&gt;&lt;P&gt;I'm using JCo 3.0 and this tutorial (http://www.vogella.de/articles/SAPJCo/article.html) to set up the connection.&lt;/P&gt;&lt;P&gt;As far as i know there are 2 methods to connect to an SAP system, via direct connection or using a connection pool.&lt;/P&gt;&lt;P&gt;But i dont know which method is used in this tutorial or how to change it afterwards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know from JCo 2.1.x that you have to close a connection after you initialized it but the author didnt do anything like this in his code.&lt;/P&gt;&lt;P&gt;Is this obsolete in JCo 3.0 or did he just forget it? (or maybe i've overlooked it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 07:45:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946113#M2839445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-10T07:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946114#M2839446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For getting a connection through connection pool...you need to look into below.....it very clearly explains your query...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/bc/eedf3d0eb8af5ee10000000a114084/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/bc/eedf3d0eb8af5ee10000000a114084/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can see in below example getting connection.....both with pool and without pool....&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nwpi711/helpdata/en/48/634503d4e9501ae10000000a42189b/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nwpi711/helpdata/en/48/634503d4e9501ae10000000a42189b/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well in Above URL there is a complete example of JCO 3.0 and they too havnt' used Release method or kind of it.....&lt;/P&gt;&lt;P&gt;If you get one do let me know also..............&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Jun 2011 10:02:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946114#M2839446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-11T10:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946115#M2839447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add to that - with JCo 3.0 there is no need to explicitly open or close connections anymore, this is done by the framework. However, in case you need to maintain a specific connection with its context, there are ways to do that, have a look at the Javadoc for JCoContext, that should give a good explanation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 18:16:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946115#M2839447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-15T18:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Java RFC Connection: Step by step</title>
      <link>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946116#M2839448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felix, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am student and beginner of ABAP. I am trying to send commands from SAP to Java. I tried searching for contents online but did not understand them since there are screenshots and I need to setup everything from start.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 14:35:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-rfc-connection-step-by-step/qaa-p/7946116#M2839448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-26T14:35:13Z</dc:date>
    </item>
  </channel>
</rss>

