cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the exceptions in a RFC ?

Former Member
0 Kudos

I can use XI (through BPM) to call a RFC and get response from the "Export" of a RFC. But could I get the exception from the "exception" of a RFC ?

I tried to write a RFC which will generate a exception and I found it in the XI monitor, but how to use it ? i.e. sometimes I need to get the "export", but sometimes I need to get "exception". Is there any documents or examples for it ? thanks.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks all of you, current status is.

I use a BPM and a "Fault Message Type", it's ok to send the exception of the RFC to the fault message type, but I cannot create a message interface to use the fault message type. Because I need to send a reply message to other system, I think I need to do a transformation in BPM, but I cannot do it. Is there any suggestion ?

This is my fault message:

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

<ns1:MyException xmlns:ns1="http://com.my/myapp">

<standard>

<faultText>PRODUCTION_ORDER_NOT_FIND</faultText>

<faultUrl>Interface data structure</faultUrl>

</standard>

</ns1:MyException>

STALANKI
Active Contributor
0 Kudos

I guess in CCBPM you can handle it through an exception branch of the block and throwing the relevant alert from a control step.

Former Member
0 Kudos

ps: I can use Fault message to get the exception from RFC, but I just don't know how to use it to reply this exception to other systems.

This is my scenario:

AP1 -> MQ -> XI -> SAP R3

I want to reply the exception to AP1 through MQ.

Former Member
0 Kudos

Dennys,

You need to use BPM in XI for this. When ever RFC is failed you can raise an alert in BPM and u can send the error message to MQ using JMS adapter. Then MQ will send it to AP1.

--Archana

Former Member
0 Kudos

Hi,

You can do this without a BPM.

In your synchronous outbound and inbound interface specify the rfc exception under the fault message.

Have a fault message mapping, where, source and target message is the rfc exception. (The target can also be any other message type).

When an exception occurs, this exception will be propagated as a message to the target system.

You could manipulate the message that would be passed to the target system, by using your own message type.

In Interface mapping, specify the mappings for request,response and fault under the respective tabs.

Regards,

Smitha.

Former Member
0 Kudos

Thanks,

I can specify request, response and fault messages in interface mapping (for synchronous) now. If RFC is successful, then I will get a response message and I can use a response message interface to send it into a receiver.

But for fault message, I don't know how to send it to a receiver. (If I can use a transformation to mapping it to other message, I think it's ok too.)

Former Member
0 Kudos

Hi,

<i>But for fault message, I don't know how to send it to a receiver.</i>

There is no other configurations that you need to do with respect to fault messages.

If the rfc returns an exception, this message, is passed on to the receiver instead of the response message.

The receiver of the fault message will be the system that sent the request.

<i>(If I can use a transformation to mapping it to other message, I think it's ok too.)</i>

You need not use a BPM, for this, in case you are using it only for fault message handling.

All you need to do is, create a message mapping, with source and target message types as RFC exceptions and carry out a one to one mapping.This would display the exception coming from the RFC as the fault response st the sender.

In case, the exception returned from the RFC is not self-explanatory, you could map constants to the target message type(in message mapping) which would explain the reason for the fault.

Regards,

Smitha.

Former Member
0 Kudos

Hi,

My sender and receiver are different system, so, the fault message cannot be sent to the sender. Therefore, I need to see the fault interface in the inbound interfaces of the business service. That's why I need to find a message interface.

Former Member
0 Kudos

Hi,

You can specify the rfc exception itself as the fault message type in the inbound interface.

You would have to create a conditional interface detemination, wherein, you would check if a particular node exists(say for ex: a node called exception). If it does, you call the IM which handles the fault message mapping, else, IM for response mapping is called.

Hope this is clear.

Regards,

Smitha.

Former Member
0 Kudos

Hi,

I put my configuration here http://dennys.tiger2.net/xi.doc and I found I got a "APPLICATION ERROR" in system. Is it the root cause ?

Former Member
0 Kudos

Hi,

The steps mentioned in the block step is incorrect.

After the receive step:

1. Place a Block(not a Switch)

2. In the normal processing branch, place the container and the send step.

3. Right click on the block and select 'insert exception branch'.

4. In this branch, place a transformation step and a send step.

In the transformation step(of the exception branch)

a. Source message(same as the container of the receive step)

b. Target message can be anything.

Map the target message to some constant which describes the error in detail. For example: 'Rfc returned an exception'

5. In the send step, send this mapped message, back to the system which is required to receive this message.

Regards,

Smitha.

Former Member
0 Kudos

Hi,

Thanks, I'm tring to configure it. But I still have some questions

step 2: What should I do in the container ?

step 4: The source message is the message of the first receiver ? But where should I put the exception message like the following ? I need to feedback the message "PRODUCTION_ORDER_NOT_FIND" to another system.

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

<Name>PRODUCTION_ORDER_NOT_FIND</Name>

<Text>Interface data structure</Text>

</rfc:RFC1.Exception>

Former Member
0 Kudos

Hi,

<i>step 2: What should I do in the container ?</i>

You had placed a container and a send step in that screenshot that you have posted. Do the same thing here.

<i>step 4: The source message is the message of the first receiver ? But where should I put the exception message like the following ? I need to feedback the message "PRODUCTION_ORDER_NOT_FIND" to another system.</i>

Yes. The source message is the message of the first receiver.( Actually it can be any container which a message in it. )

Carry out a mapping, between the source message(which is the same as your container message for first receiver) and target message(which is the same as the rfc1.exception message that you have posted above.)

Now map a contant value to the node <Name>.

The value of the constant will be PRODUCTION_ORDER_NOT_FIND

Hope this is clear.

Regards,

Smitha.

Former Member
0 Kudos

Hi,

but rfc1.exception message is a fault message, I cannot build an abstract message interface for it. And because I cannot build an abstract message interface, I cannot put it in the BPM.

Former Member
0 Kudos

Hi,

Yes, you can build an abstract asynchronous message for a fault message and use it in the BPM.

All you need to do, is to create a message interface(as for any other MI) and put the fault message as the message type

Regards,

Smitha.

Former Member
0 Kudos

Hi,

I'm using XI 3.0 sp17, when I try to create an abstract asynchronous message interface, I cannot select a fault message type. I can use select a fault message type from a synchronous message interface. Could you help to confirm it ?

Former Member
0 Kudos

Hi,

I have tried this on SP16. It must be possible with SP17 also.

Try using the F4 help, to select the rfc1.exception else drag n drop it into the message type text box.

Regards,

Smitha.

Former Member
0 Kudos

Hi,

This is my procedure, I still cannot assign a rfc1.exception to a message type.

1. Create a new message interface.

2. Choose abstract and asynchronous

3. Click input help to try to select message

4. Choose "Imported Objects"

5. Choose "RFC Messages"

6. I can only see "RFC1" and "RFC1.Response" here, I cannot find "RFC1.Exception".

I can only see "RFC1.Exception" when I use a synchronous and see it in the "Fault message".

Former Member
0 Kudos

Hi,

I am not sure why this is happening. But the exception entry appears when you try a drag and drop.

RFC's request, response and exceptions would be displayed from which you can select the exception.

Regards,

Smitha.

Former Member
0 Kudos