cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically changing JCOs

Former Member
0 Kudos

Hello all,

is there an API to programmatically change the JCOs instead of using the content administrator. I often have to switch the underlying R3 system and so dealing with the content administrator is sometimes a little bit monotonous.

Anyone who has an idea where to find related information, please tell me.

Thank you

volker

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Well check out this link.

http://help.sap.com/saphelp_nw04/helpdata/en/42/9be327cf147142be9edf9056e27801/frameset.htm

See if the above link is what you are looking for.

But why would you like to change your JCO connection at runtime. I mean you would be only talking to a single R/3 at one point of time right.

What is your scenario. If we could know that then it would be useful to help you out.

regards

ravi

Former Member
0 Kudos

Hello Ravi,

thanks for your quick reply. I do not want to change my JCOs

at runtime. But if I have to change a system because it is

down, I do not like very much to click x-times for reconfiguring the JCOs.

Another question: In the link you gave me, there is a line:

com.sap.lcr.api.cimclient.CIMClient cimClient = WDSystemLandscapeFactory.getClient();

For me, it is not possible to import the class WDSystemLandscapeFactory using Organize Imports. Does anybody know where to find it?

Best regards,

volker

Former Member
0 Kudos

Hi

Well the only way to do what you are looking at is

1. Create the JCO destinations for the number of SAP systems that you have in the WebDynpro Content Administrator. For Eg : "DEV" and "TST"

2. Create a properties file called "Connection.properties". Maintain a property in the file say "JCOConnectionName=DEV"

3. For reading the properties file please refer to the link http://help.sap.com/saphelp_nw04/helpdata/en/b8/aa343e32ff1033e10000000a114084/frameset.htm

4. Now if the system is down and you would like to change the system name just edit the properties file and change the name from "DEV" to "TST".

5. The only additional change you will have to do is open up your application and do the following steps.

Steps :

If you want to change only the JCO Destinations that your model refers to, then its very much possible to change their names.

But if the model stucture has got changed , then you should reimport that.

I guess, trying out the following steps for changing the names will work out for you.

1) For Medata Dest--

a) Click on the local disctionary stucture that has been generated by importing the model.

b) Click on the properties tab on the bottom right corner.There you shoulb be able to change the Metadata dest name.

2) For Application data Dest-

a) Right Click on model classes (model_Input & model_output) & then click EDIT.

b) Same Way, on the bottom right corner , Change whichever proerty you want to alter inlcuding the Dest Name.

In this way, you can mainten unique JCO references for all the models you are using in your project.

ReBudild & Redploy the entire project . Create the New JCOs Destinations in the content Admin & happily run your application.

Let me know if that helps you.

regards

ravi

Answers (0)