Application Development and Automation 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: 
Read only

error handling in abap proxy

Former Member
0 Likes
4,157

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,677

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.

2 REPLIES 2
Read only

Former Member
0 Likes
2,678

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.

Read only

0 Likes
2,677

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