cancel
Showing results for 
Search instead for 
Did you mean: 

Capture Metadata mismatch exception

Former Member
0 Kudos

Hi WD4Jers,

Is there a way to capture the exception arising out of the Meta data mismatch in RFC metadata and WebDynpro context meta data. It is a well known fact that the RFC meta cache needs to be cleared to ensure proper functioning of a WD4J application using RFC, if the RFC has undergone a change at the structural meta data level.

However, the question is, is there a elegant way to catch this exception and show a meaningful message on the WD4J screen / application, that the cache needs to be cleared instead of showing up the error stacktrace, as this results in loss of the form fields data ?

Any pointers will be appreciated.

BR,

Bala

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

In catch block of code put the if conditions. First you identify the for that exception what expection Message you will get by using e.getMessage

Observe the below code

catch(Exception e){

IWDMessageManager message = wdThis.wdGetAPI().getMessageManager();

message.reportException(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("RFC_ERROR"),true);

if(null!=e){

if("USER_NOT_FOUND".equalsIgnoreCase(e.getMessage()))

{

message.reportException(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("NOT_MAINTAINED_PERN") + usrid,true);

}

Regards

_SS

Former Member
0 Kudos

Sridhar,

The question is not about how to write a try / catch block in WebDynpro. The question is about capturing the exception that arises on RFC meta data mismatch i.e @ runtime, the control doesn't go the catch block, and simply throws up the stack trace.

Former Member
0 Kudos

Hi

At any point of time it will goes to catch block at Rumtime.

If you want cross verify put the Print messages in all the catch blocks of your code.

It's completely depends upon the developer , how u catch Runtime errors.

Before catch you have to know all the possible Runtime errors.

Hope you understood.

At Runtime or Designment.

In the above mentioned example is Runtime exception of METADA only

Regards

-SS