Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Exception handling

Former Member
0 Kudos


I need to react to JCO.ABAPExceptions thrown in an Javaclass in the ABAP RFC functionmodule.

I connect Java and ABAP by the SAP JCo RFC provider service.

I generate a new JCO.ABAPException with an exceptionclass that is defined in the functionmodule in ABAP (WRONG_INPUT). But sy-subrc is always the value for 'OTHERS'.

Where is my mistake? Does SAP JCo support this way of throwing Abap exceptions?

Thanks for your help.



Former Member
0 Kudos

If the function module is RFC Enabled, I am surprised that it allows Exceptions. All RFC Enabled function modules do not have exceptions thrown, instead they use internal tables like RETURN where the error messages are stored.

Let me know if I went the wrong direction or didn't understand your problem correctly.


Subramanian V.

0 Kudos

Exceptions are allowed.

You can handle exceptions while using rfc functions. I do so in few function modules.

And the JCo seems to support this functionality, for in the direction J2EE=>ABAP you can distunguish between different exception classes but the other way round???

You can get the ABAP-name of the exception from java code but I need it vice versa when I call a EJB from ABAP.

Thank you