cancel
Showing results for 
Search instead for 
Did you mean: 

Get the jcoconnection to the CRM backend in CRM 7.0

Former Member
0 Kudos

Hi Experts,

We have implemented CRM7.0 where we have 2 jco connections, one to ECC backend and the other one to CRM backend. By default it connects to the ECC backend. When i use getDefaultJCoConnection() function to get some FM, it searches in the ECC fot that FM. I don't want to make the CRM backend as default also because in my requirements i need to call custom FMs from both ECC and CRM backened.

Please help me out here.

Thanks,

Gary

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can use the getDefaultJCoConnection(Properties conDefProps) method to call another system based on the properties.

To read the properties, you can use the Managed config.

Take a look at the method

getDefaultConnection(String facName,String conConfigName,Properties conDefProps) in the class com.sap.isa.core.eai.ConnectionFactory

Pradeep

Former Member
0 Kudos

Hi Pradeep,

Thanks for your answer. Could you be more specific as what do you mean by calling another system based on the properties and what are these properties you are talking about? i'll defintly have a look at the method told by you, but right now i don't have the src code. I have asked my basis to provide me the source folder for the 7.0. I have one more question, if i know the name of my CRM backend system, can't i directly call it by name?

Thanks,

Gary

Former Member
0 Kudos

These are the backend connectivity parameters for JCO. take a look at the XCM and you can build the same properties. before calling the new method. In this way, that connection will be for the CRM system

Calling directly by the system name isnt possible. You will need to construct the JCO parameters to get the connection

Pradeep

Former Member
0 Kudos

Thanks Pradeep for your answer, but could you please help me out with some code. I did try to create connection directly with the CRM backend with the following code.

JCO.Client mConnection = CO.createClient("001", // SAP client

"<userid>", // userid

"****", // password

"EN", // language (null for the default language)

"<hostname>", // application server host name

"XX"); // system number

But this code is still not working, I am giving the user id and password which we have used for the JCO settings and it says invalid user name or Passoword. So my question is do i have to use the JCOUSER id to connect to CRM Backend or some other id?

Former Member
0 Kudos

Hello,

You can store the connection parameters in a property file in the project build path. This should atleast these details

1. User name

2. Password

3. Message server host

4. SID

5. Client

Then create a property object

Properties props = new Properties();

read the properties from the file. any java developer can help you with that.

One read, then call this method

connection = getDefaultJCoConnection(props);

Now this connection obj points to the CRM system. With this access the FM like

JCO.Function funcObj= connection.getJCoFunction("CRM_FM_NAME");

Pradeep

Former Member
0 Kudos

Hi Pradeep,

Thanks a lot for your answer. I was also thinking on the similar lines of creating my own getDefaultJCoConnection(props) function and fill in the properties file with all the information required for connection, but here i am stuck as what are names of these all connection parameters e.g client, userId, passwd,systemId,Lang and SysId.

Do you know what are the exact names of these all keys which are required to make the connection ?

Thanks,

Gagan

Former Member
0 Kudos

here you go....

bapiPool

jco.client.client

jco.client.user

jco.client.passwd

jco.client.lang

jco.client.ashost

jco.client.sysnr

Former Member
0 Kudos

Thanks Pradeep . Point Awarded

Former Member
0 Kudos

Appreciate. Hope the issue is resolved.

Pradeep