cancel
Showing results for 
Search instead for 
Did you mean: 

Application Error :: Exception Handling

Former Member
0 Kudos

Hi

Workflow of my scenario is -->

<b>SAP R/3 -- Sender RFC Adapter -- XI -- Rec. SOAP Adapter -- Web Service</b>

In case we are sending correct information to WebService, we are getting results back to SAP R/3. But in case of an Application Error in Web Service ( like wrong data value ), it is returning following payload as response -->

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

- <!-- Call Adapter

-->

<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">vessptd01</ns1:hostname></i>

So I created the XSD file for this payload & map it with my <i><RFC>.Exception</i> structure, folliwing is my Exception message mapping text preview -->

<i>/ns1:Z_MAPINFO.Exception/Name=const([value=UNKNOWN ADDRESS]) /ns1:Z_MAPINFO.Exception/Text=/ns0:hostname= /ns1:Z_MAPINFO.Exception/Message=const([value=0]) /ns1:Z_MAPINFO.Exception/Message/ID=const([value=I]) /ns1:Z_MAPINFO.Exception/Message/Number=const([value=11]) /ns1:Z_MAPINFO.Exception/Attributes=const([value=1]) /ns1:Z_MAPINFO.Exception/Attributes/V1=/ns0:hostname=</i>

Now when I executed the scenario, I can see in SXMB_MONI ( with Application Error as status ) that following RFC XML is going to SAP R/3 server -->

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

- <ns1:Z_MAPINFO.Exception xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<Name>UNKNOWN ADDRESS</Name>

<Text>vessptd01</Text>

- <Message>

<ID>I</ID>

<Number>11</Number>

</Message>

- <Attributes>

<V1>vessptd01</V1>

</Attributes>

</ns1:Z_MAPINFO.Exception></i>

But still SAP R/3 is giving Short DUMP with the message as

<b>Message type " " is unknown.</b>

although ABAPers are trying to catch exception fields. Also one thing I noticed that when I imported the <RFC>.Exception structure in XI, I see field names like

"<i>Name, Text, Message, ID, Number, Attributes, V1, V2, V3, V4</i> ".

But in SAP R/3 RFC when ABAPers define Exception for RFC, they see following fields -->

<i>MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.</i>

Now I am not sure what is going wrong. Can you pls. suggest.

- Lalit -

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Lalit,

I believe whatever the response you are getting from Webservice is working good. During mapping to RFC, you are getting an error, Try to check the structure of the RFC or just define the data type and pass it to RFC instead of importing the RFC.

It is totally related to Invalid structure only, or try to load the RFC import structure into XML spy and check whether it is valid one or not.

Regards,

B.Anandh

Answers (2)

Answers (2)

Former Member
0 Kudos

Scenario is working fine & ABAPers are actually handling the message & displaying a Info Box to the user saying " Invalid Address ".

- Lalit -

Former Member
0 Kudos

Lalit,

Its complaing about the response message mapping. Check your response mapping. It is having some issues. I think if you resolve that then your scenario should work perfect.

Also you are saying that it is a wrong data, If it is yes that then how are you going to handle in production? I think you should not have wrong data in prodcution. So exclude that scenario if it is wrong data. Also check with few test cases. If it is same for the corect data then you should check your response mapping.

---Satish

Former Member
0 Kudos

Satish

Our scenario is actually getting the Latitude & Longitude of given location from Web-Service, so when the address details are correct. SAP R/3 is getting populated with correct response i.e Latitude & Longitude.

But in case when User is entering Wrong Address ( which does not exist ), we are getting following payload as response from Web-Service -->

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

- <!-- Call Adapter

-->

<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">vessptd01</ns1:hostname></i>

In which it is just returning the Host Name of server in which it is installed.

I actually pasted the Text-Preview of my Exception Message Mapping also, do you see any error in that.

I have no issues with Request & response Message Mapping.

- lalit -

Former Member
0 Kudos

Lalit,

I would recommend to have a fault message type and send this response to the user stating you have entered a wrong data.

For some info. on writing this:

/people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1

---Satish

Former Member
0 Kudos

Hi Satish

I was using the Fault Message Type only.

I resolved the issue, actually when ABAPers create the exception in RFC they give some pre-defined values & those values come as part of the enumerated Data Type & you need to send those values exactly the way threy stored in RFC.

I was missing the undersocre (_) initially.

Thanks for all who answered.

- Lalit -

bhavesh_kantilal
Active Contributor
0 Kudos

Lalit,

I have been seeing you work on the fault messages for sometime now and finally it seems to be cracked.

IS it okie if we guys can ask you a step by step guide of what needs to be done? Or maybe even a blog etc?

Regards

Bhavesh

Former Member
0 Kudos

Sure Bhavesh.

I will definitely do that & list down the steps in case of Application Error.

But still I am working what to do in case of System Error ( in case Server is down or netowrk is down ), I am taking 2 approaches in that, one is with BPM & one is without BPM.

- Lalit -

bhavesh_kantilal
Active Contributor
0 Kudos

Thanks!

Regarding the issue when the server is down etc, wouldnt XI Alert's help?

Regards

Bhavesh