cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch SAP application errors in BPM.

Former Member
0 Kudos

Hi,

I have a IDOC to Soap Sync Scenario where I send the message to a Webservice. I have used a BPM since we need to catch the resposne of this message and map it to a RFC. For ex if I get a success resposne I need to map success if not than I need to catch the error and map it to the RFC. Now here in some cases like if the target system (webservice) is down than XI raises a sap application error:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Inbound Message

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/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.aii.af.ra.ms.api.DeliveryException: Connection refused (errno:239)</SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack />

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

</SAP:Error>

Normally XI stops the process in these cases and does not proceed to the next step but I need to catch this message and map the content in the AdditionalText to the target RFC. Can anyone let me know how to catch this SAP Application Error in BPM and map it to the RFC.

Thanks,

Bhargav

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi!

Define an exception in your ccBPM (step) and then handle it.

Regards,

Volker

Former Member
0 Kudos

Hi Volker,

I do have an exception branch in my BPM. But when an application error is raised like the one i mentioned below it is not even executing the exception branch. It is simply stopping the BPM Process.

Thanks,

Bhargav

Former Member
0 Kudos

Hi!

Did you also define a Fault Message in your service interface for the SOAP communication?

Regards,

Volker

Former Member
0 Kudos

Hi Volker,

For the above specified application error how do I specify the Fault message. Can you elaborate a bit more on this.

Thanks,

Bhargav

Former Member
0 Kudos

Hi!

For synchronous communication in your service operation you normally specify a request and a response message - and optionally also a fault message.

Regards,

Volker

Former Member
0 Kudos

Hi Volker,

yes we can specify a fault message type but for the above mentioned message it contaings the names as SAP:ERROR in the names of the fields and in XI I cannot specify the names with ":".

Thanks,

Bhargav

Former Member
0 Kudos

Hi Bhargav!

Now I do not really understand your problem, because SAP: is nothing else than a namespace in the Fault Message as you can see here ...

<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

Maybe I'm too tired to understand your problem now, because here in Central Europe it's 11.30 p.m. ....

Regards,

Volker

Former Member
0 Kudos

Hi,

Can you share your mail so that i can send a detailed description of my problem to you with the screenshots.

Thanks,

Bhargav

Former Member
0 Kudos

Hi Bhargav!

Unfortunately the forum blocks any posts containing an email address ...

Regards,

Volker

P.S. You may watch my business card .... You cannot expect any answers from me before tomorrow late evening (CET).

Former Member
0 Kudos

Hi Bhargav

you can define fault messages for SOAP

http://www.w3.org/TR/2000/NOTE-SOAP-20000508/

and use them when the target system down error. allow to raise exception. Define a container variable for fault message.

Thanks

Gaurav

Former Member
0 Kudos

Hi Gaurav,

As I have mentioned I need to catch the application error in the BPM. If you see the discussion that is mentioned after the blog you have mentioned it is stated that the fault messages or the application error cannot be caught in BPM.

In the blog that you stated we can catch the fault message and map it to a message structure but only to that extent after that it would stop the BPM process at that step but would not proceed further as shown in the screenshot given in the blog it would fail as "application error restart not possible".

I need to proceed further and capture this error to an RFC Structure and call a proxy.

Here after the error it does not proceed to the next step.

Thanks,

Bhargav

Former Member
0 Kudos

Hi Bhargav!

As far as I can see you should encapsulate the SOAP SEND step in a separate Processing Block defining the exception in your Send Step and defining a dedicated exception handling branch.

Currently it looks as if you have one exception branch and this is only called when the first step of your BPM throws an error.

Regards,

Volker

Former Member
0 Kudos

HI Bhargav

Basically after getting the fault message response you map it to trigger any exception. This can trigger the BPM to proceed furthur. More over if this doesnt work then you can write ABAP report to trigger the Workflow for some condition. Now when you get this fault message let the report based on the conditoon you set, trigger the BPM again to move the message furthur.

Give it a try

Thanks

Gaurav