cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive RFC Connection Not Mandatory

Former Member
0 Kudos

Hi,

I have an WebDynpro Application where the data that I retrieved from SAP is not considered mandatory for the application. If I can connect to SAP, run the RFC and retrieve the data successfully, I will display the data to the user. However, if the SAP connection fails or the RFC fails, I want my application to continue on and ignore the SAP connectivity problem (and just display zero in the output field, etc).

Here is my live scenario:

The SAP Backend Server is down for maintenance for a month, and now my application throws an exception immediately. No output to the user is possible. The Context area of my views references the controllers/models, and as a result, my application seems to fail miserably.

My question is this:

Is it possible to construct the SAP connectivity (adaptive RFC) such that a connection is not mandatory! I've tried surrounding the connection code (bind, execute) with try/catch blocks but that did not help. It seems that no matter what, my application with fail in the JCO connection if the server is not responding.

Thanks

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Why don't you check the JCO connectivity before executing the model. Use the link below:

[Link|http://wiki.sdn.sap.com/wiki/display/Snippets/AutomatedBackupMonitoringSystem-ImplementingJCobasedapplications.]

Just use the createConnection method in the link above. Supply the parameters through the properties file or hard code it just for testing. If connection is available execute your model otherwise don't execute it and display whatever you want.

I have not tried with this createConnection method but used something similar to solve the same scenario.

Hope it helps.

Regards,

Manoj

former_member182374
Active Contributor
0 Kudos

Hi Manoj,

Running JCO code directly without using destinations is not best practice when dealing with Web Dynpro.

Omri

Former Member
0 Kudos

Hi,

Could you please elaborate what do you mean by destination here.

Sorry got it. You mean to say the JCO destinations which you specify in WD Content Administrator.

Anyways It may not be a best practice but this is why the JCO java API is provided.

Regards,

Manoj

Edited by: Manoj on Jan 12, 2010 4:55 PM

Answers (1)

Answers (1)

former_member182374
Active Contributor
0 Kudos

Hi Kevin,

As far as I know this is not possible because the METADATA connection is being used before the wdDoInit of your application.

try/catch works for MODELDATA because it runs on demand (from your code).

Regards,

Omri

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Kevin, Omri

The problem with RFC METADATA could be solved if you try to create the RFC model node in the context dynamically. This will allow you to embrace the code in try/catch and handle the wrong connection exception.

So try to use the API methods below in order to create the RFC model node at runtime:

IWDNodeInfo.addChild(...);
IWDNodeInfo.setModelClassInfo(...);
IWDNodeInfo.setSupplyingRelationRole(...);
IWDNodeInfo.addAttributesFromModelClassInfo();

Personally I haven't checked the solution, but I think it shall help in your case.

BR, Siarhei