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.
cancel
Showing results for 
Search instead for 
Did you mean: 

Exception handling

Former Member
0 Kudos
70

Hello,

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.

Jan

2 REPLIES 2

Former Member
0 Kudos
39

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.

Regards,

Subramanian V.

0 Kudos
39

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

Jan