cancel
Showing results for 
Search instead for 
Did you mean: 

Calling two diferent R3 systems for same RFC

Former Member
0 Kudos

Hello Everybody,

My scenario is:

I have one RFC in two different systems. this is the same RFC available on two systems. I want to call this RFC from the Web dynpro application. System will be determined at runtime to call this RFC.

If user selects System XYZ then using hte same RFC model, RFC should be executed on XYZ. If user selects System ABC then using hte same RFC model, RFC should be executed on ABC.

Can we achieve this using single RFC model in one web dynpro application?

If not, then can we create two RFC models containing same RFC?

Regards,

Bhavik

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Bhavik,

As I know, it's impossible to call a different RFC withing one web dynpro application instance if you want to only use one model.

<i>You cannot change the mapping of destinations within a running application instance, i.e. concurrent access to different backend systems within an application instance is not possible. </i>

The text above is snipped from the page 17 of the following document.

http://www.google.com/url?sa=t&ct=res&cd=2&url=https%3A%2F%2Fwww.sdn.sap.com%2Firj%2Fservlet%2Fprt%2...

That means you can only choose the JCO destination when start the application.

Correct me if it's wrong.

Regards,

Hui

former_member211296
Participant
0 Kudos

Hai,

For two different R3 system for same RFC is possible. Here you need to create JCO connection at the run time. For that you write oen method in the component controller.

Method in the component controller:

-


client=JCO.createClient(mandt,sapid,password,lang,sapip,id);

return client;

Here you need to give nesscesary values for the mandt, sapid(sapuserid),password,lang,sapip(R3_IP),id(SYS_ID)

and before executing the BAPI in the view

-


you need to write this coding.

JCO.Client client1=wdThis.wdGetCv_AZR_ClientController().getJcoClient();

client1.connect();

Zorg_Read_Message getModel =(Zorg_Read_Message)com.sap.tc.webdynpro.progmodel.model.api.WDModelFactory.getModelInstance(Zorg_Read_Message.class ,WDModelScopeType.TASK_SCOPE);

getModel.setJcoClient(client1);

after this coding you may excute like create the objects and bind input values and get the necessary output.

try this,

Kind regards,

R.Hariprasath

Former Member
0 Kudos

Hi Hariprasath,

Here what you are saying is to change <b>model data</b> of RFC model runtime. That is even I have done using RFC destinations available under visual admin.

But, how can we change Metadata connection at runtime. Becuase, Meta data is pointing to only one system at runtime and we cannot change metadata runtime.

Even though RFCs are same on two different backend system, it will not allow you to call RFC with metadata fetched from other system.

Thanks,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

Use these links for ur requirement.

The logical target system name is configured in the Web Dynpro Content Administrator.

With the configuration of the Portal page, you pass the following URL parameters with the Web Dynpro application. These parameters are then taken into account when the application is started.

sap.wdarfc.useSys=<DEFAULT_SYSTEM>:<SUFFIX_OF_MAPPED_SYSTEM>

If several systems are to be mapped, the parameter sap.wdarfc.useSys can be repeated any number of times within a URL entry. One parameter entry is made for each logical system.

The URL parameters for the Portal page are maintained as described in the Administration Guide of the SAP Enterprise Portal.

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/af/84a34098022a54e10000000a1550b0/frameset.htm">Multiple systems</a>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/82/76a2406546ba15e10000000a1550b0/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/82/76a2406546ba15e10000000a1550b0/content.htm</a>

<a href="/people/anilkumar.vippagunta2/blog/2007/02/06/dynamic-jco-creation:///people/anilkumar.vippagunta2/blog/2007/02/06/dynamic-jco-creation

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/77/931440a1c32402e10000000a1550b0/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/77/931440a1c32402e10000000a1550b0/content.htm</a>

regards

Sumit

Former Member
0 Kudos

Hi Sumit,

I guess this should work as far as I am passing parameters in the URL.

But is there any way to set or change these parameters from the code?

Why I am asking this is, based upon some functionality in the application, I have to detemine which system needs to be called.

It is not pre-determined that which system I need to call.

Thanks,

Bhavik

dhawal_joshi
Employee
Employee
0 Kudos

Hi Bhavik ,

Yes it is very much possible to use multiple RFC. For each model the backend connection is determined according to the JCO destinations which you specify while creating the model . Thus if you create different JCO destinations for each model then they would connect to different backend specified .

Although you will have more than one JCO connection for such case and thus it is not best of the design . To make it more clean you could import model in 2 different DC and re-use in a UI DC .

regards

dhawal