cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically chage the destination JCos

Former Member
0 Kudos

Hi all,

I have developped an appliation that was based on the single JCo only but now my problem is need to be deploy into another system that contain another JCo .

Please suggest me how write the code for dynamically change the JCo destinations.

Suggest me .

Thanks

Lohi

Accepted Solutions (0)

Answers (3)

Answers (3)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos
Former Member
0 Kudos

Hi

Double click on the proxy classes created under 'Models', one of its property will be model data destination and you can change it there.

Similarly, for metadata destination, click on the dictionary created for that model (under dictionaries) and edit the property by that name.

Regards

Leena

Former Member
0 Kudos

Hi ,

thanks your response ,

I think this is statically change the single JCO.

Not the dynamic change.

Any other ideas.

Thanks

Lohi

Former Member
0 Kudos

Hi,

You can set the client to be used dynamically. Use a code like this:

Let's say the name of your model is FetchListOfMaterials.


FetchListOfMaterials getModel = (FetchListOfMaterials)com.sap.tc.webdynpro.progmodel.model.api.WDModelFactory.getModelInstance(FetchListOfMaterials.class,WDModelScopeType.TASK_SCOPE);
getModel.setJcoClient(<your client>);

Do check that the structure of the BAPI/RFC has not changed.

Regards,

Satyajit.

Former Member
0 Kudos

Hi

You have to Create the Model from scratch using the new JCO destinations and do the model bindings and context mappings.NO WAY OUT. I know, this is tedious but this is the most safe way to accomplish this. Although in the SDN you will find articles that describes how to change JCO destinations after model creation but that doesn't work correctly.

Hope this helps

Regards

Ananda