cancel
Showing results for 
Search instead for 
Did you mean: 

Message Split

Former Member
0 Kudos

Hi,

We have a requirement in our project to split the incoming msg into N number of messages based on a particluar field(PLANT) . This field(PLANT) repeats multiple times in the input payload and can have different values.

The message corresponding to each PLANT should be routed to different receiver.

For Ex : Plant A to Receiver1

Plant B to Receiver 2

Plant c to Receiver and so on.

There can be totaly 21 different values for Plant field.

Ex Input xml :

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

<ns0:MT_dbXXX xmlns:ns0="urn:novartis.com:pi:ph:0x:XXX">

<row>

<PLANT>A</PLANT>

<EXTERNAL_NUMBER>12</EXTERNAL_NUMBER>

<BATCH_G>Batch_G1</BATCH_G>

</row>

<row>

<PLANT>B</PLANT>

<EXTERNAL_NUMBER>13</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

<row>

<PLANT>C</PLANT>

<EXTERNAL_NUMBER>14</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

</ns0:MT_dbXXX>

Output should be :

Receiver1 should get :

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

<ns0:MT_dbXXX xmlns:ns0="urn:novartis.com:pi:ph:0x:XXX">

<row>

<PLANT>A</PLANT>

<EXTERNAL_NUMBER>12</EXTERNAL_NUMBER>

<BATCH_G>Batch_G1</BATCH_G>

</row>

</ns0:MT_dbXXX>

Receiver 2:

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

<ns0:MT_dbXXX xmlns:ns0="urn:novartis.com:pi:ph:0x:XXX">

<row>

<PLANT>B</PLANT>

<EXTERNAL_NUMBER>13</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

</ns0:MT_dbXXX>

Receiver 3:

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

<ns0:MT_dbXXX xmlns:ns0="urn:novartis.com:pi:ph:0x:XXX">

<row>

<PLANT>C</PLANT>

<EXTERNAL_NUMBER>14</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

</ns0:MT_dbXXX>

Can anyone please sugest how to do this.

Regards

Jagruthi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Go through this blog..

/people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16

Former Member
0 Kudos

Hi,

After using extended Receiver determination , i am able to get multiple messages in PI but each messages is having the complete input payload which is not our requirement.

Each messages should have the rows corresponding to a specific PLANT.

Please suggest on this.

The out put now looks like :

Receiver 1 :

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

<ns0:MT_dbXXX xmlns:ns0="urn:novartis.com:pi:ph:0x:XXX">

<row>

<PLANT>A</PLANT>

<EXTERNAL_NUMBER>12</EXTERNAL_NUMBER>

<BATCH_G>Batch_G1</BATCH_G>

</row>

<row>

<PLANT>B</PLANT>

<EXTERNAL_NUMBER>13</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

<row>

<PLANT>C</PLANT>

<EXTERNAL_NUMBER>14</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

</ns0:MT_dbXXX>

Receiver 2

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

<ns0:MT_dbXXX xmlns:ns0="urn:novartis.com:pi:ph:0x:XXX">

<row>

<PLANT>A</PLANT>

<EXTERNAL_NUMBER>12</EXTERNAL_NUMBER>

<BATCH_G>Batch_G1</BATCH_G>

</row>

<row>

<PLANT>B</PLANT>

<EXTERNAL_NUMBER>13</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

<row>

<PLANT>C</PLANT>

<EXTERNAL_NUMBER>14</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

</ns0:MT_dbXXX>

Receiver 3

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

<ns0:MT_dbXXX xmlns:ns0="urn:novartis.com:pi:ph:0x:XXX">

<row>

<PLANT>A</PLANT>

<EXTERNAL_NUMBER>12</EXTERNAL_NUMBER>

<BATCH_G>Batch_G1</BATCH_G>

</row>

<row>

<PLANT>B</PLANT>

<EXTERNAL_NUMBER>13</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

<row>

<PLANT>C</PLANT>

<EXTERNAL_NUMBER>14</EXTERNAL_NUMBER>

<BATCH_G>Batch_G2</BATCH_G>

</row>

</ns0:MT_dbXXX>

Regards

Jagruthi

Edited by: jagruthi Rao on Aug 20, 2010 3:06 PM

Former Member
0 Kudos

HI,

Please refer the below blogs:

/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

/people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object

Thanks,

Former Member
0 Kudos

> After using extended Receiver determination , i am able to get multiple messages in PI but each messages is having the complete input payload which is not our requirement.

I see the problem here, actually you have to use the BPM so go through the blog to know the BPM steps.

/people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure

Below are the points which you have to take care while designing your scenario.

1. For your scenario since output structure is same therefore you need to change the occurrence as 0..unbounded of target message under "Message" Tab in your message mapping.

2. Also change the occurrence as 0..unbounded of target message interface in your Interface mapping.

3. Create message interfaces(abstact asynchronous) to use in Interface mapping since you are goning to use BPM.

4. In BPM you have to use FORK and do the RD as shown in the blog.

5. In ID you have to do conditional receiver determination to pass the data to desired receivers only.

Let us know if you need more help.

Answers (2)

Answers (2)

Former Member
0 Kudos

solved using Value mapping function in message mapping.

Former Member
0 Kudos

Hi,

Follow the below steps to achieve your requirement.

1. You need to provide occurance of the field to be 1..Unbounded.

2. Do the mapping according to the requirement.

3. In the Receiver Determination, you need to select " Extended" in the Type of Receeiver determination.

Thanks,