cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple receivers for same message

former_member190358
Participant
0 Kudos

Hello Everyone,

My requirement is where customer is sending an XML message and this gets converted into IDOC.

This XML message has one node which if it has value as X and Y , then it should go to one ERP system.

And if this tag is empty or other than X and Y, then it should go to another ERP system.

So, i have set the rule in receiver determination, but it is not working.

The rule is if

/shipment/SalesCodeCompany = "X" OR /shipment/SalesCodeCompany = "Y"

then ERP1

else if

/shipment/SalesCodeCompany = space OR /shipment/SalesCodeCompany Not equal to  "X" OR /shipment/SalesCodeCompany not equal to " Y "

then ERP2.

But this is not working .

Everytime, the idoc is getting created in both the ERP systems, irrespective of the value in the node.

I dont know whats wrong. PLs comment.

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Ravi,

The issue is with your "else" condition. It says: code not equal "X" OR code not equal "Y". And this is always true, because if code = "X", then the second part is true (code <> "Y"), and if code = 'Y", then the first condition is met (code <> "X").

Instead of defining the else as you have it now, leave your condition for Receiver A as you have it, and choose Receiver B as the default receiver if the condition for system A is not met (the real "else"), as follows:

Regards,

Greg

Answers (2)

Answers (2)

gagandeep_batra
Active Contributor
0 Kudos

Hi Ravi

you can make ur else condition  like that:

/shipment/SalesCodeCompany = space OR (/shipment/SalesCodeCompany Not equal to  "X" AND /shipment/SalesCodeCompany not equal to " Y ")

Regards

Gagandeep

former_member184681
Active Contributor
0 Kudos

Hi,

Very much possible, and it could be even a better solution than mine, assuming that the value is really SPACE and not empty, or non-existent, or something like that

Regards,

Greg

kumaramar
Advisor
Advisor
0 Kudos

Hello Ravi,

Apart from what Greg suggested, there is one more way. In the receiver determination steps, define 2 receivers but just define condition (/shipment/SalesCodeCompany = "X" OR /shipment/SalesCodeCompany = "Y") for first receiver (ERP1). For the second receiver, leave the condition field blank. This means that the message will go to first receiver (ERP1) only when the condition is true. Else in all other cases, it will go to second receiver ERP2.

Regards,

Amar

former_member184681
Active Contributor
0 Kudos

Hi Amar,

Actually what you're saying isn't true, if you asked me. If you provide two lines in receiver determination, one with condition and one without, here is how it will work:

- if the condition is met, message will be sent to both receivers (which is incorrect, as Ravi has already stated)

- if the condition is not met, message will only be sent to the second (unconditional) receiver.

In other words, the second receiver is not considered as an "else" receiver.

Regards,

Greg

kumaramar
Advisor
Advisor
0 Kudos

Hello Greg,

Yes you are correct. I missed this. Sorry...

Regards,

Amar

former_member190358
Participant
0 Kudos

Hello Greg,

I think you are correct and this will definitely behave the way u said.

However, i will try to adapt your suggestion and  see if this works.

Thanks,

Ravi

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Ravi,

Why dont try using multi mapping without BPM concept and write a condition in mapping level,this is one more way of doing your req.

Best Regards,

Raj