cancel
Showing results for 
Search instead for 
Did you mean: 

Change JCO at runtime

Former Member
0 Kudos

Hi all,

Is there any way to change the used JCO at runtime?

Aviad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Aviad,

What exactly you'd like to change? RFC destination? JCo connection properties? Something else?

VS

Former Member
0 Kudos

Hi All,

Thanks for all the links you have attached.

Valery -

I have 2 JCO model data defined in my system and according to the users group (which can be seen at runtime) I decide which JCO to use.

The bigger picture is that I want to connect to my backend using SSO or using single user mapping, which depands on the portal users group.

Thanks,

Aviad

Former Member
0 Kudos

Aviad,

Assuming that you are using Adaptive RFC model you need to:

1. Get model itself using WDModelFactory.getModelInstance(Class modelClazz):

https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/model/api/WDModelFacto...


IWDDynamiRFCModel myModel = 
  (IWDDynamicRFCModel)WDModelFactory.getModelInstance(YourRfcModel.class);

2. Get configured JCo connection from system landscape:

https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/sal/sl/api/WDSystemLand...


IWDJCOClientConnection cliConnection = 
  WDSystemLandscape.getJCOClientConnection("MyDataConn");

3. Set JCo connection on model:

https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/modelimpl/dynamicrfc/IWDDynamicR...


myModel.setJcoClient( cliConnection.getClient() );

Note, that you only may alter data connection (metadata connection can't be modified). Also note that both meta- and data- connections must point to the very same server. I hope that this is your case while your requirement is to "connect to my backend using SSO or using single user mapping, which depends on the portal users group."

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Answers (3)

Answers (3)

former_member189631
Active Contributor
0 Kudos

Aviad,

Please go through this pdf link for Runtime JCO.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8ea0af90-0201-0010-3590-f70b0780...

Reward points if its helpful.

Regards,

Ramganesan K.

sid_sunny
Contributor
0 Kudos

Hi Aviad,

Go through this <a href="http://help.sap.com/saphelp_nw04/helpdata/en/42/9be327cf147142be9edf9056e27801/frameset.htm">link</a>

Regards

Sid

Former Member
0 Kudos

Hi,

Yes there is a way to change. Go through .

Regards,

Satyajit.