14 Replies Latest reply: Feb 28, 2012 9:57 AM by hema s RSS

exception handling with fault message type not working

hema s
Currently Being Moderated



I have a sync proxy to proxy scenario and I have created a fault MT and specified in the outbound and Inbound service interface...


*In Inbound proxy I have the following code--*......


RAISE EXCEPTION TYPE z_cx_test_fault



standard = l_standard_data.



In the sender side abap code which calls the outbound proxy I have the follwing code -





CATCH cx_ai_system_fault INTO lo_cx_ai_system_fault.

txt = lo_cx_ai_system_fault->get_text( ).

WRITE txt.


CATCH z_cx_test_fault INTO lo_cx_test_fault.

txt = lo_cx_standard_message_fault->get_text( ).

WRITE txt.


CATCH cx_ai_application_fault INTO lo_cx_ai_application_fault.

txt = lo_cx_ai_application_fault->get_text( ).

WRITE txt.




when i test the inbound proxy separately I get the custom fault message properly...


however when i run the proxy to proxy sync scenario and the custom exceptionz_cx_test_fault  is raised inside the receiver proxy .......control goes to CATCH cx_ai_application_fault    and not CATCH  z_cx_test_fault .


I understand that cx_ai_application_fault is the super class of all the exception class but why does control go to its exception handling when a custom exception is raised...


Edited by: hema T on Feb 26, 2012 1:16 PM


Edited by: hema T on Feb 26, 2012 1:17 PM