cancel
Showing results for 
Search instead for 
Did you mean: 

Offline Adaptive RFC Model

0 Kudos

Hello Everybody,

is there a way to use an Adaptive RFC Model without beeing connected to the backend system?

I'm working on an application that uses Adaptive RFC models to fetch data from a backend R/3 system. This works as long as the application is deployed on a engine that has the proper JCO connections defined.

When I try to deploy the application on another engine which isn't connected to the R/3 backend the application doesn't even start. It immediately throws WDTypeNotFoundExceptions and complains about missing JCO connections... Well, so far nothing unexpected since the JCO connection isn't there in the first place.

Now I need to deploy this application both online and offline. I built a wrapper DC around the model which is supposed return dummy data when the application can't connect to the backend system. I also tried to initialize the model component manually to catch the JCO Exceptions and return the dummy data. This doesn't work though. The model gets initialized automagically and still dies with WDTypeNotFoundExceptions...

Any ideas how to get around this problem?

Thanks, I appreciate your help,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Michael

You could get away if you at a minimum define the Metadata destination. This because on first request of the application the metadata for the backend objects needs to be cached and so the system tries to make a call to SAP using the connection parameters defined in the metadata destination. If destination does not exist your program abends and thats what you are getting.

Regards

Pran

0 Kudos

Thanks for your reply, Pran.

I see. So you're saying that applications that use Adaptive RFC models will <b>never</b> run without at least the metadata connection?

Is it possible to catch the exception or supress/fake the metadata caching? I just want to use an alternative method to provide the data if the JCO connection isn't available.

Former Member
0 Kudos

Hi Micheal

I feel it is not possible to catch the exception or supress the error.

Regards

NagaKishore

Former Member
0 Kudos

Hi Michael

This is possible Michael. The error occurs only when the controllers having the context for those model objects are initialised.

What you could do is have a Tester View that is hit first this should not have any model attributes (should not have model binding directly or indirectly). This view could check for the conditions such as existence of the destination etc . If found successful navigate to the actual View or component(via interface view).

The rough code for this would be



	try{
	IWDJCOClientConnection jcoIWDClient = WDSystemLandscape.getJCOClientConnection("<DESTINATION_NAME>");
	JCO.Client jcoClient = jcoIWDClient.getClient();
	if(jcoClient == null){
    	//flag as no connection to SAP available
	}
	}catch(WDSystemLandscapeException wds){
          //flag as destination does not exist
	}

0 Kudos

Thanks, Pran.

This is the solution for my problem. I implemented two custom controllers. The first one handles the rfc call in case the JCO connection is available. The second one generates dummy data otherwise.

The only problem is that I have to copy the data manually from the model nodes to value nodes. Since I can't use the model nodes when JCO is not available.

Too bad WDCopyService can't copy model onto value nodes....

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Everybody,

I did not understand the answer very well.

Is it possible to make a dummy (false connection) that simulates a connection pool with SAP?

I making a system that integrates JAVA and SAP, but i don't have a real system SAP to make the tests.

If you know how i do this, can you send to me a example?

Thank's

Luiz Vaz