cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch JCO exception in web dynpro java

Former Member
0 Kudos

Hello,

I have a scenarion where the JCO connection Exeption has to be trapped and dispaly the user defined error message...

How to trap it..

I used the following the code, but it doesn't work.

catch (JCO.AbapException ex) {

if (ex.getKey().equalsIgnoreCase("NOT_FOUND")) {

messageMgr.reportException("Dictionary structure/table not found.",false);

System.exit(1);

}else {

messageMgr.reportException(ex.getMessage(),false);

System.exit(1);

}

}catch (JCO.Exception ex) {

ex.printStackTrace();

System.exit(1);

}

Accepted Solutions (0)

Answers (2)

Answers (2)

p330068
Active Contributor
0 Kudos

Hi Pradeep,

In web dynpr of Java, You don't need to handle JCO exceptions if you are using JCO Destination for model creation.

But if you are creating Dynamic JCO Handling in web dynpro for Java, then please have a look at [Dynamic JCO Handling|http://wiki.sdn.sap.com/wiki/display/Snippets/DynamicJCOHandling-Creation,Updationetc]

Please refer to [Exception Handling|http://help.sap.com/saphelp_nw04/helpdata/en/68/46e13d82fcfb34e10000000a114084/content.htm] and [JCo Exceptions|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/f6/daea401675752ae10000000a155106/frameset.htm]

Hope it helps

Regards

Arun

Former Member
0 Kudos

Pradeep,

If you are talking about exceptions in ABAP BAPI/Function Module; then it has to be handled at BAPI level only and populate Exception parameter so that EP application knows.

Portal Application can handle the exception based on exception resturn values.

Please let me know if my understanding is correct.

Regards,

ganga