cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple receivers for same rfc msg type

Former Member
0 Kudos

I have a soap-XI-RFC scenario. I have to read the soap message and depending on the key field value, I have to send to two different SAP systems.

For EX:

Input Message:

<input_msgType>

<item>

<Key>ABC-123452</Key>

<value>test1</value>

</item>

<item>

<Key>ABC-342222</Key>

<value>test2</value>

</item>

<item>

<Key>XYZ-676767</Key>

<value>test2</value>

</item>

<item>

<Key>XYZ-565655</Key>

<value>test2</value>

</item>

</input_msgType>

Output Message1:

<BAPI_SEND_DATA>

<item>

<Key>ABC-123452</Key>

<value>test1</value>

</item>

<item>

<Key>ABC-342222</Key>

<value>test2</value>

</item>

</BAPI_SEND_DATA>

Output Message2:

<BAPI_SEND_DATA>

<item>

<Key>XYZ-676767</Key>

<value>test1</value>

</item>

<item>

<Key>XYZ-565655</Key>

<value>test2</value>

</item>

</BAPI_SEND_DATA>

I have to send the same rfc request data to two sap systems..all the key with ABC starting Key should go to SAP system1

and all the key with XYZ key should go to SAP system 2.

Should I split the message in mapping - if so how can i do it? What kind of BPM steps should I do?

Can I do this in receiver determination itself using condition? THanks for suggestions and help..

Thilothama

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi, This can be achived by having the same SOAP message to RFC1 and SOAP- RFC2 so you will be having 2 message mapping and 2 interface mapping.

in the receiver determiantion if you have any condition specify that else just give the 2 different SAP system and in the interface determination specify the 2 RFC 's as 2 different interface.

I had the same scenarion and it worked perfectly.

If you need any more help send me your email i can send you the doc.

regards,

Shree

STALANKI
Active Contributor
0 Kudos

Have two message/interface mappings one mapping that maps th source to bapi11 and target to bapi2.

Create 2 interface determinations with 2 recievers.

Former Member
0 Kudos

Is it ok to split a single mapping to 2 different ones instead of doing it in a single step?

Former Member
0 Kudos

Hi,

You can do the mapping as

SOAP - RFC1

SOAP - RFC2

it will be 2 different mappiing .

Former Member
0 Kudos

Hi,

You can do this in Message Mapping itself. You can use use "startsWith" function of Text category to check and use that to Map accordingly.

If your scenario is a synchronous scenario then u need to go for BPM.

Regards,

P.Venkat

Former Member
0 Kudos

Its a sync scenario and I alreaddy have a big BPM in place. So I do a split/Message mapping and do a send step in BPM. But I shld send the same rfc to two diff SAP system...which based on condition in RFC - should send to multiple receivers right?

Thanks for all your help...

Thilothama

Former Member
0 Kudos

Hi

you can do this in the condtion editor of the Receiver determination

Regards

Vijaya

Former Member
0 Kudos

The weblog mentioned above splits the message into two different target messages. Can anyone point me to an example where the target message occurance is unbounded and based on the key values in input - group them and for every unique key, a target msg is created? Thank you...

moorthy
Active Contributor
0 Kudos

Hi,

This you can do based on the Mapping.. ie. You need to search for all the key in the input xml and then generate corresponding structure for each key value.

For this it is prefer to use Java Mapping, where you can look for the key and group them together and post one RFC per Key...

anyway you have BPM inplace and you can execute this transformation step over there.

In this case, for each key it will create one RFC. ie even you can have ForEach Loop to call the RFC in the BPM

Hope this helps,

regards,

moorthy

Former Member
0 Kudos

Krishna Moorthy,

I came to a point where I decided that Java mapping would be the best for this. But do you have some sample starts for this??? I would appreciate if you can show me some light...

Would something like this help??

public void getPhonesById(String[] a, String[] b, String[] c, ResultList result, Container container){

Map map = (Map) container.getParameter("phones");

if (map == null){

map = new HashMap();

for (int i = 0; i<b.length; i++){ // if the payload is valid to xsd, b and c have equal length

List list = (List) map.get(b<i>);

if (list == null){

list = new ArrayList();

map.put(b<i>, list);

}

list.add(c<i>);

}

container.setParameter("phones", map);

}

List list = (List)map.get(a[0]);

for (int i = 0; i< list.size(); i++) result.addValue((String) list.get(i));

}

Thanks and appreciate your help

Thilothama

Message was edited by:

Thilothama v

bhavesh_kantilal
Active Contributor
0 Kudos

> The weblog mentioned above splits the message into

> two different target messages. Can anyone point me to

> an example where the target message occurance is

> unbounded and based on the key values in input -

> group them and for every unique key, a target msg is

> created? Thank you...

Hi,

You can use multimapping without BPM for a single message as well. Your requirement is that you need to group your KEY into a single rfc request message.

Well, change the occurence of the target message to N in the message and interface mapping and do the mapping logic to create N numbr of RFC request messages to be sent via the RFC adapter and it will work fine.

Multi Mapping does not refer to only having multiple messages of different type it can also be multiple messages of the same type.

Regards,

Bhavesh

Former Member
0 Kudos

>>>Your requirement is that you need to group your KEY into a single rfc request message

This is where I am stuck...How do I group them??? Java UDF will work??

I have the unbounded option for RFC in Mess Mapping. Do you have any example of grouping by key??

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Not sure if there is an example as such for the same.

Will try this and see if i can figure it out.

Like pointed by moorthy, this would be simple using a Java Mapping.

Regards,

Bhavesh

Former Member
0 Kudos

Is this possible with Java UDF or only with Java class - java mapping?

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

><i>Can I do this in receiver determination itself using condition? THanks for suggestions and help..</i>

This cannot be done on the reciever determination as you need to filter records on the basis of the key values and then combine all key values into a single RFC message ( one each for every key value) .

You would need to use a Split / Multi Mapping and so, follow the blog in my previous reply and it can be achieved.

Regards,

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

No need for a BPM.

You can do a multimapping without a BPM from Sp14 onwards.

Take a lookat this blog,

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

Regards,

Bhavesh