‎2008 Jun 04 6:24 PM
Hi,
In my scenario, I have written code in the execute_synchronous method of the abap proxy in ECC. I want to capture all possible errors that might occur here and for all of them i want to capture the message id and the text and send it out. what kind of possible errors/exceptions can occur and how to handle them. My proxy class simply selects data from multiple tables in ECC and returns the same.
thks
‎2008 Jun 04 6:42 PM
Hi,
for outbound proxies the error handling should be done within R3 itself and there is no need to send errors to XI or receiving system for that matter. You would want someone from R3 side to take a note of it.
For Inbound proxies, you will have to implement the Fault messages
Fault message types are designed for application-specific errors that occur on the inbound side and that are reported back to the sender or persisted in monitoring.
· In the synchronous case, when an application-specific error occurs on the inbound side, instead of sending a response message back to the sender, the application can send a fault message to handle the error.
· The fault message of the application for an asynchronous ABAP server proxy is persisted for monitoring. In the case asynchronous of Java server proxies, the fault message is part of a negative application acknowledgement (see Acknowledgments).
Application-specific means that the application on the inbound side triggers the error itself because, for example, the request message did not contain sufficient information.
For more information on the same.
http://help.sap.com/saphelp_nw04s/helpdata/en/dd/b7623c6369f454e10000000a114084/frameset.htm
In your case, since you said that you are selecting data from some tables, the possibility is that an entry is not found in the DB tables you will have to simply populate the fault message data and raise an expection CX_FM. It also depends on what error handling requirements from the Business .
regards,
Advait.
‎2008 Jun 04 6:42 PM
Hi,
for outbound proxies the error handling should be done within R3 itself and there is no need to send errors to XI or receiving system for that matter. You would want someone from R3 side to take a note of it.
For Inbound proxies, you will have to implement the Fault messages
Fault message types are designed for application-specific errors that occur on the inbound side and that are reported back to the sender or persisted in monitoring.
· In the synchronous case, when an application-specific error occurs on the inbound side, instead of sending a response message back to the sender, the application can send a fault message to handle the error.
· The fault message of the application for an asynchronous ABAP server proxy is persisted for monitoring. In the case asynchronous of Java server proxies, the fault message is part of a negative application acknowledgement (see Acknowledgments).
Application-specific means that the application on the inbound side triggers the error itself because, for example, the request message did not contain sufficient information.
For more information on the same.
http://help.sap.com/saphelp_nw04s/helpdata/en/dd/b7623c6369f454e10000000a114084/frameset.htm
In your case, since you said that you are selecting data from some tables, the possibility is that an entry is not found in the DB tables you will have to simply populate the fault message data and raise an expection CX_FM. It also depends on what error handling requirements from the Business .
regards,
Advait.
‎2008 Jun 04 7:16 PM
Thanks Advait.
I have written my code inside the execute_synchronous method of the proxy class. Inside that Can I catch the cx_ai_system_fault as follows:
CATCH cx_ai_system_fault.
DATA : fault TYPE REF TO cx_ai_system_fault,
gv_message type string.
CREATE OBJECT fault.
gv_message = fault->get_text( ).
message e014(zmsg) with gv_message.
here what kind of system fault r we expecting ? and if this fault occurs will XI receive the message ? I had created this abap proxy based on a MI from XI.
for select statements i assume i have to capture a different type of exceptions and put the message in some structure. In any of tehse cases, will control return to XI and from there can these messages be passed to the source system ?
thks