cancel
Showing results for 
Search instead for 
Did you mean: 

Retriving Exceptions code /SY-subrc from RFC Function module in Java

Former Member
0 Kudos

How to retrive Return Code(SY- SUBRC) from function module called in java.

Below is example where i would like to retrive the Exceptions from 1..5

-


CALL FUNCTION 'ZZ_SAVE_TEXT'

EXPORTING

RUECK = pass number

TABLES

T_LINES = pass user enter text

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

The exception can be caught from Java by mentioning the exception as export parameter in the RFC Function module .

Local Interface:

*" IMPORTING

*" VALUE(JOB_ID) TYPE HROBJID

*" VALUE(JOB_TYPE) TYPE ZZ_CHAR2

*" EXPORTING

*" *VALUE(SUBRC) TYPE SYSUBRC*

Thanks

Ritushree

Former Member
0 Kudos

To get any information from the function module, you must specify it in any of the export parameters. So please pass the value through the export parameter and then you will get this value in Java.

Best Regards,

Vipin