cancel
Showing results for 
Search instead for 
Did you mean: 

Changing RFC Metadata/Modeldata at runtime

Former Member
0 Kudos

Hi

I have a scenario where there are 2 identical BAPIs in 2 different SAP systems.

We import the BAPI structure through ARFC model. Then based on some business logic, it should execute the BAPI from either one of the SAP systems.

Is it possible to programmatically change the ModelData information of the Model at runtime ?

Thanks

Sayan

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

My question is still not answered.

I have the same BAPI existing in multiple SAP Backend systems. I need to change the RFC destinations at runtime from Webdynpro Java based on some business logic.

Creating multiple models (one for each SAP system) is not an option as the client does not want to have so many different models created.

Is there a way I can change the Metadata and Modeldata destinations at runtime ?

I am using CE 7.3.

Thanks

Sayan Ghosh

junwu
Active Contributor
0 Kudos
i think you have no choice other than creating multiple models
or you can use pure jco api to do the job
Former Member
0 Kudos

Hi Jun,

I tried using the JCO APIs. But they are deprecated in CE 7.3 since we are now using Adaptive RFC Destinations instead of JCO destinations.

Thanks

Sayan Ghosh

junwu
Active Contributor
0 Kudos

no, you didn't get it, i said pure jco programming,

no model, no destination, everything is done using jco api.

Former Member
0 Kudos

But I need one static metadata and modeldata destination to import the Model BAPI structure at design time. If I create the JCO through programming, how do i import the BAPI structure using the ARFC Model wizard ?

junwu
Active Contributor
0 Kudos

you can call rfc through jco, which will return you data.

just like the jdbc programming, which will retrieve data from db

Former Member
0 Kudos

Hi Jun,

This sounds good. I guess its like calling a BAPI from a normal Java program using JCO APIs. But now the question is, JCO destinations are deprecated. Now we have RFC destinations that are created directly in NWA. Do we still use old JCO APIs to call the BAPI from Java program ?

Thanks

Sayan Ghosh

junwu
Active Contributor
0 Kudos
i haven't touched jco api for long time.
maybe now you can reference the destination created in nwa from your jco code.
Former Member
0 Kudos

Hi Sayan,

You need to create RFC destination pointing to different source systems manually in NWA, which you have already done. Use the correct destination while calling the RFC.

Best way is to have view which takes the input as hostname, password, username and password. Once the user has provided all these inputs, you can through program check if corresponding RFC- destination exists or create if is not present. Then use the destination to execute the RFC.

Regards,

Manoj

Former Member
0 Kudos

Hi Ghosh

please close discussion if answered

regards

junwu
Active Contributor
0 Kudos
just create two model.
Former Member
0 Kudos

Hi

1. As I see it you have tweo options: obne change the JCO at runtime. see this thread.

2. Alternatively, you can take the desigbn time approach and build a new model,
     tie it up to your second JCO and call the BAPI at design time.
    Personally, I feel this way is more  reliable and robust. I have done it myself and it
    just works! I know some puritans will argue that this approach just unnecessarily duplicates
    code, buy hey calling two systems is also sort of duplication....

regards

yuval peery