cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle exceptions in sender ABAP Proxy

gopalkrishna_baliga
Participant
0 Kudos

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:

<SAP:Error xmlns:SAP="XI/Message/30" xmlns:SOAP="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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Gopal,

please try it with method get_longtext( ).

Regards

Markus

gopalkrishna_baliga
Participant
0 Kudos

Hi Markus,

I tried get_longtext also but this also does not return anything.

Thanks

Gopal

samiullah_qureshi
Active Contributor
0 Kudos

You can get the ack from outbound proxy as given in following link:-

[http://help.sap.com/saphelp_nw04/helpdata/en/f4/8620c6b58c422c960c53f3ed71b432/content.htm]

Former Member
0 Kudos

>

> 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:

>

> <SAP:Error xmlns:SAP="XI/Message/30" xmlns:SOAP="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

Hi Gopal,

Maybe the exception is CX_SY_APPLICATION_FAULT, or you can catch by BPM in PI and send back to proxy like a message response.

gopalkrishna_baliga
Participant
0 Kudos

Hi spantaleoni,

My code is throwing cx_ai_system_fault exception. I have checked it while debugging.

Thanks

Gopal

Edited by: gopalkrishna baliga on Jan 12, 2011 12:04 PM

Former Member
0 Kudos

>

> Hi spantaleoni,

>

> My code is throwing cx_ai_system_fault exception. I have checked it while debugging.

>

> Thanks

> Gopal

>

> Edited by: gopalkrishna baliga on Jan 12, 2011 12:04 PM

Have you tried to catch the exception by BPM on PI?