Skip to Content
0
Jan 12, 2011 at 05:39 AM

How to handle exceptions in sender ABAP Proxy

423 Views

Hi Experts,

I have a synchronous scenario.

SAP R/3 System A -ABAP Proxy < -> PI <-----> SOAP< ---> Webservice

In system 'A', a function module calls the ABAP Proxy method.

My requirement is that if there is an exception in PI ( for example: timeout or ABAP engine error) then I want to get the exception details in the calling function module.

For example:

Exception in PI:

http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIAdapterFramework</SAP:Category>

<SAP:Code area="MESSAGE">GENERAL</SAP:Code>

<SAP:P1/><SAP:P2/>

<SAP:P3/><SAP:P4/>

<SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.net.ConnectException: Connection timed out: connect</SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace=""/>

<SAP:Stack/>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

In the calling function module:

Try

Call to proxy-> method

Catch cx_ai_system_fault INTO v_o_fault.

v_err_msg1 = v_o_fault->GET_TEXT( ).

v_err_msg2 = v_o_fault->errortext.

v_err_msg3 = v_o_fault->code.

Endtry.

Here I get value "MESSAGE.GENERAL" for v_err_msg1 and v_err_msg3. v_err_msg2 is blank.

I want to capture the info available under <SAP:AdditionalText>. How to get that?

Please help!

Thanks & Regards

Gopal