cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple responses to single request

Former Member
0 Kudos

I receive a single HTTP request, map this to an RFC and make a call to SAP. Straight forward so far but my problem is that the structure of the XML I send back to the 'requestor' will depend on the response from SAP.

For example, the following is sent if my call to SAP returns data

<SUCCESSRESPONSE>

<CUSTOMERDETAIL>

<ACCOUNTNO>123456</ACCOUNTNO>

<NAME>MR SMITH</NAME>

</CUSTOMERDETAIL>

<CUSTOMERDETAIL>

<ACCOUNTNO>654321</ACCOUNTNO>

<NAME>MR JONES</NAME>

</CUSTOMERDETAIL>

</SUCCESSRESPONSE>

If SAP fails to locate any data

<FAILRESPONSE>

<ERROR>No customers located</ERROR>

</FAILRESPONSE>

Obviously everything starts with a message interface but it appears you can only have one 'input' message.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Jitendra_Jeswan
Contributor
0 Kudos

Ofcourse One Message Interface would have One Message (if the Interface is Synchronous, it would have req. and resp. messages). However you can create a Message type such that some node in the Message type can have multiple Occurances.

And then While doing Message Mapping from RFC response to this Message you can create multiple occurances of the Node..

Please elaborate on the Scenario further to help you find the resolution.

Former Member
0 Kudos

The problem isn't that I want to send back multiple repeating rows - I understand how that works. My problem is that I want to send back different responses depending upon what I get back from SAP.

In my example if SAP returns a list of customers I will send that back to the requester using a specific message type. If SAP doesn't locate any customers then I want to send back a response using a different type. From what I know of XI I can only use one message to return data.

Jitendra_Jeswan
Contributor
0 Kudos

You can create a Single Message Type (with 2 data types, one for each requirement)which appears as 2 Different Nodes in message type. Use one Node that sends back list of customers and is compliant to tthe message type you are using for this.

for the other requirement when SAP could not locate any customer , using your Message MApping you only create the other node in your Message type.

Hope this will help you acheive the desired results.

Regards.

Edited by: Jeet Jeswani on Jan 29, 2008 12:37 PM

former_member859847
Active Contributor
0 Kudos

Typo error to previous reply.

i mean two message mappings followed by single interface mapping.

Regards

mahesh.

Former Member
0 Kudos

Jeet,

Thank you. Your answer got me most of the way to solving the problem. As you state it's all about the message mapping. I've created a datatype with two nodes. One created if I get the data I need from SAP and the other created if I don't. Although I'm using a single message interface I'm returning different structures.

Thanks

Answers (1)

Answers (1)

former_member859847
Active Contributor
0 Kudos

Hi Robert,

your requirement is just like HTTP(SYNC)-RFC(SYNC).

both HTTP message interface and RFC shold be synchronous.

you have to do two message mappings followed by one message mapping.

regards

mahesh.