cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Mapping to multi receiver

Former Member
0 Kudos

Hello all,

I having a req that incoming IDoc hac multiple files say,

<IDoc Name>

     <IDoc>

          <Field1>

          <Field2>

     <IDoc>

          <Field1>

          <Field2>

     <IDoc>

          <Field1>

          <Field2>

Based on field 2 i need to send multiple receiver. For ex if my field2 is 10 i need to send receiver 1, if my field2 is 20 i need to send receiver 2, if my field2 is 30 i need to send receiver 3 and so on..

I searched google and unable to get solution. Please help out of this. This is in high priority.

Regards

Amar

Accepted Solutions (1)

Accepted Solutions (1)

Muniyappan
Active Contributor
0 Kudos

Hi,

check this blog. it is for 2 messages. you can use it for 3 messages.

http://wiki.scn.sap.com/wiki/display/SI/Step+by+Step+guide+to+Explain++Enhanced+Receiver+Determinati...

in the enhanced receiver determination you determine the list of receivers.

you need three message mapping.

in first mapping create target node if Field2 is 10

in scond mapping create target node if Field2 is 20

in third mapping create target node if Field2 is 30

Regards,

Muni.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi to all,

We achieved this using Multimapping. So closing this thread, Thanks to all for giving your valuable suggestion.              

Regards

Amarnath

former_member202642
Participant
0 Kudos

Hi Amarnath,

Please mention your solution for the above scenario. Give a brief overview, as this

would be helpful for new learners.

Harish
Active Contributor
0 Kudos

Hi Amarnath,

Please close the discussion, refer the below blog for how to close the discussion

regards,

Harish

Former Member
0 Kudos

Hi Aamir,

Ya sure.

We achieved this with multimapping(1:N) with 3 interfaces. So we not defined any condition in Receiver Determination.

With Regards

Amarnath

0 Kudos

Hi Amarnath,

If your mapping is similar for 3 receivers and just based on field2 if you need to route to receiver then you can go for Enhanced receiver determination and you can choose your receiver system dynamically.

If your mapping is different for 3 receivers then you can implement 3 different mappings and use normal receiver determination to choose the receiver.

Regards,

Sudha

Harish
Active Contributor
0 Kudos

Hi Amar,

If you have multiple receiver for each condition then why you want to implement in multimapping?

You can route the message to specific receiver in receiver determination (based Fielld 2 value is 10, 20 and 30).

and for each receiver you have different interface determination and different mapping. the below wiki can be use as reference

How to determine receiver system in case of multiple operations? - Process Integration - SCN Wiki

Hope this is clear.

Regards,

Harish

Former Member
0 Kudos

Hi Amarnath,

You can achieve your requirement in two ways.

1)Multi mapping

2)Enhanced receiver determination , (map b/w sender structure,receiver1 structure),(map b/w sender structure,receiver2 structure),...

I personally prefer 2nd option because it looks very clean design and efficient than multi mapping.

2)In enhanced receiver determination use the below udf.

field2-->mapwithdefault-->remove context-->sort-->splitbyvalue (valuechange)-->collapsecontest-->udf-->receiver1,service1,receiver2,service2..............

for(int i=0;i<n;i++){

     if(input[i].equals("10")){

          receiver1.addValue("");

          service1.addvalue("BSNAME");

     }

else if(input[i].equals("20")){

          receiver2.addValue("");

          service2.addvalue("BSNAME");

     }

............

................

.........

}

In individual mappings just send those respective records

field2-->mapwithdefault-->remove context-->equals("10")-->if-->mt_receiver1

field2-->mapwithdefault-->remove context-->equals("20")-->if-->mt_receiver2

NOTE:We need to go for either of the above approach because we need to check record in sender structure .

Regards

Venkat