cancel
Showing results for 
Search instead for 
Did you mean: 

Message content comparison

Former Member
0 Kudos

Hello,

I intend to create a BPM includes the following steps:

<b>1)</b>

A Receive step receives xml message via HTTP in the following format and there can be 1000 <Lot> records:

<MT_PO_Request>

<Lot> (0~unbounded)

<PO_NUM> (1~1)

<Status> (1~1)

</Lot>

</MT_PO_Request>

<b>2)</b>

Another Receive step to query all the unclosed PO records from SAP.

<b>3)</b>

Verify <PO_NUM> against with PO number values of the query result.

If they match, update <Status> tag to 'S';

If not, update <Status> tag to 'F'.

<b>4)</b>

Split them into 2 xml messages based on <Status> and insert them into two different tables.

<b>My questions are:</b>

1)How do I do it? Where do I make the comparison and splitting? (what STEPs to use, correct configuration, any coding/udf/add-on involved,etc.)

2)Which RFC to use for PO query?

Regards,

Steve

Message was edited by: steve peng

Accepted Solutions (0)

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Steve,

You have a Split of the Messages based on the <LOT> . You will have a transformation inside the BPM that will split the Single Source Message into N RFC request messages for which the R3 system will be called sequentially or parallely and then, you will collect the N rfc responses and switch over these response to collect valid and invalid and then do the necessary send in of the Switch branch.

Regards,

Bhavesh

Former Member
0 Kudos

Hello Bhavesh,

<b>0)</b>

In your solution, looks like it all can be configured? no coding effort? Can you provide the exact STEPS that you'd use here? Since there are multiple records, would a Loop Step be used here?

<b>1)</b>

<i>You have a Split of the Messages based on the <LOT> .</i>

Based on <Status>, u mean?

And what is "Split"? A customized STEP?

<b>2)</b>

<i>You will have a transformation inside the BPM that will split the Single Source Message into N RFC request messages for which the R3 system will be called sequentially or parallely</i>

My original thought was to pull all the records from SAP in a single call (a batch call that does the same thing every time - pull unclosed PO records) and make the comparison within XI, but your comments looks like sending each <PO_NUM> to SAP to make the comparison in multiple calls? Wouldn't that be a performance issue?

<b>3)</b>

<i>you will collect the N rfc responses and switch over these response to collect valid and invalid and then do the necessary send in of the Switch branch.</i>

Is this where you update the <Status> tag? How?

Regards,

Steve

Message was edited by: steve peng

Former Member
0 Kudos

Hi Bhavesh,

Are you still available to help on this problem?

Regards,

Steve

bhavesh_kantilal
Active Contributor
0 Kudos

Steve,

>><i>You will have a transformation inside the BPM that will split the Single Source Message into N RFC request messages for which the R3 system will be called sequentially or parallely

My original thought was to pull all the records from SAP in a single call (a batch call that does the same thing every time - pull unclosed PO records) and make the comparison within XI, but your comments looks like sending each <PO_NUM> to SAP to make the comparison in multiple calls? Wouldn't that be a performance issue?</i>

Misunderstood your requirements.This design would help.

Steps :

1.Receive -- To receive Source Message.

2. Receive -- to receive PO records.

3. Do a N:N Mapping inside the BPM. Source will be the 2 Receive Steps and target will be the valid message and the inavlid message.

4.Send Step -- To send Valid records ( Inside a block )

5. Send Step -- To send Invalid Records ( Inside a block.)

Regards,

Bhavesh

Former Member
0 Kudos

Bhavesh,

<i>3. Do a N:N Mapping inside the BPM. Source will be the 2 Receive Steps and target will be the valid message and the inavlid message.</i>

-N:M Mapping can be done in a single mapping object that resides in a TRANSFORMATION step? Not SWITCH step?

-2 source messages and 2 target messages?

-Graphical mapping or other types of mapping?

-The multiple comparision and <Status> update can all be done in here? No LOOP step required?

<i>4.Send Step -- To send Valid records ( Inside a block )</i>

-Inside a block?

Regards,

Steve

Message was edited by: steve peng

Message was edited by: steve peng

former_member187339
Active Contributor
0 Kudos

Hi steve,

You have mentioned that if the Po number matches then status field should be updated as S else F. You have to go for BPM with these steps:

1) receive1

2) receive2

3) transformation1 (comparition)

4) transformation2 (splitting)

5) send

<u><b>Logic for comparision</b></u>

<b>Your Source</b>

<u>source 1</u>

<MT_PO_Request>

<Lot> (0~unbounded)

<PO_NUM> (1~1)

<Status> (1~1)

</Lot>

</MT_PO_Request>

<u>source 2</u>

>><i>Another Receive step to query all the unclosed PO records from SAP.</i>

what is the structure? You have to provide this structure.

Now mapping should be like this:

Source1------ Graphical mapping------ Target1

Source2

The target structure should be same as source1. In the graphical mapping you have to write the logic for updating the STATUS field.

<u><b>Logic for splitting</b></u>

<i>>>Split them into 2 xml messages based on <Status> and insert them into two different tables</i>

What is the format for this structure? Only then this can be decided.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Thanks for the response.

<i>source 2

>>Another Receive step to query all the unclosed PO records from SAP.

what is the structure? You have to provide this structure.</i>

-The structure is:

<Query_Result>

<item> (0~unbounded)

<WA> (1~1)

</Query_Result>

<i>The target structure should be same as source1. In the graphical mapping you have to write the logic for updating the STATUS field.</i>

-"Write the logic" means a UDF needs to be created for comparison and <Status> update? How?

-Does it update Source1 or Target1?

-So this is a N:1 example?

<i>>>Split them into 2 xml messages based on <Status> and insert them into two different tables

What is the format for this structure? Only then this can be decided</i>.

-The after-split structure should be in JDBC-insert format of XML.

-So this is an 1:N example?

Regards,

Steve

former_member187339
Active Contributor
0 Kudos

Hi,

>>-"Write the logic" means a UDF needs to be created for comparison and <Status> update? How?

Actually no need for UDF, if you can do them in Graphical mapping, using inbuilt functions.

>>-Does it update Source1 or Target1?

Target1 (I think this is having the same structure as source 1)

>>So this is a N:1 example?

wht i think this is to b a 1:1 mapping, bcoz u r mapping it in a single Message Mapping.

>>-The after-split structure should be in JDBC-insert format of XML.

-So this is an 1:N example?

Yes bcoz you r goinng to insert it repeatedly.

Regards

Suraj

Former Member
0 Kudos

Suraj,

<i>-The after-split structure should be in JDBC-insert format of XML.

-So this is an 1:N example?

Yes bcoz you r goinng to insert it repeatedly.</i>

How do I perform the 1:N mapping by graphical mapping tool to map the structure below?

(Same structure for Source and Target)

<MT_PO_Request>

<Lot> (0~unbounded)

<PO_NUM> (1~1)

<Status> (1~1)

</Lot>

</MT_PO_Request>

Regards,

Steve

former_member187339
Active Contributor
0 Kudos

Hi,

In the Message mapping, go to the third tab Messages. In the target add one row and add your MT there. Change its occurence to 0.. unbounded. Come to fisrt tab and do mapping.

In BPM, wrap a block around the transformation step that uses this message mapping.

Regards

Suraj

former_member206604
Active Contributor
0 Kudos

Hi,

You can go to the message tab and change the occurance of the target message and carry out the mapping again. You also need to change the occurance in the Interface Mapping as well.

Refer this blog

/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi

Regards,

Prakash

Former Member
0 Kudos

Suraj,

<i>In the Message mapping, go to the third tab Messages. In the target add one row and add your MT there. Change its occurence to 0.. unbounded. Come to fisrt tab and do mapping.</i>

-Let me further clarify my questions here. I'm only mapping ONE source to TWO targe messages here. And all of their structures are identical. And I want only 2 output target messages. If so, Do I still need to change the target occurence to "0..unbounded"?

-Why is a "Block" required here?

Also, how is the mapping done by graphical mapping tool if i want to split them into 2 target messages based on <Status> tag? (Only 'G' & 'F' values exist)?

Regards,

Steve

former_member187339
Active Contributor
0 Kudos

Hi steve,

I think you are getting confused... Tell whether I have understood your problem correctly.

You have a structure <b>(say A)</b> like

<MT_PO_Request>

<Lot> (0~unbounded)

<PO_NUM> (1~1)

<Status> (1~1)

</Lot>

</MT_PO_Request>

which will be compared with another structure <b>(say B)</b>

<Query_Result>

<item> (0~unbounded)

<WA> (1~1)

</Query_Result>

and based on this comparision you will update the status field of a structure <b>(say C)</b> like

<MT_PO_Request>

<Lot> (0~unbounded)

<PO_NUM> (1~1)

<Status> (1~1)

</Lot>

</MT_PO_Request>

PS: This sturcture is same as <b>A</b>

For doing this do a simple graphical message mapping, with sources as <b>A and B</b> and target as <b>C</b>. In that mapping compare and update the status in traget structure.

Now you have to split C based on the status. The resulting output will be <b>(say D)</b> like

JDBC-insert format of XML.

Create a mapping between <b>C and D</b>, in this mapping your source will b C and target will b D. As written in my previous mail you change the occurence of D in the messages tab and then follow the steps written in previous post.

Hope this clarifies your problem.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Thanks for the clear and thorough review of what we've discussed so far.

<i>Now you have to split C based on the status. The resulting output will be (say D) like

JDBC-insert format of XML.

Create a mapping between C and D, in this mapping your source will b C and target will b D. As written in my previous mail you change the occurence of D in the messages tab and then follow the steps written in previous post.</i>

From my understanding, there will only 2 JDBC-insert format target messages for BPM to perform BULK data insert in 2 different routes and 2 different SEND steps.

If I change the Occurrence of the target message in the MESSAGE Tab to '0~unbounded' and split them, wouldn't there be tons of target messages? And tons of single data insert performed by the SEND step?

Regards,

Steve

Message was edited by: steve peng

former_member187339
Active Contributor
0 Kudos

Hi,

<i>If I change the Occurrence of the target message in the MESSAGE Tab to '0~unbounded' and split them, wouldn't there be tons of target messages? And tons of single data insert performed by the SEND step?</i>

Yes. Do you need a one time insert? Actually i am not having a server for testing so I can't confirm whether single insert will work or not, you have to try it yourself.

Regards

Suraj

Former Member
0 Kudos

Suraj,

Alright. Thanks a lot. Guess I'll keep looking in the forum. Appreciate your help.

Regards,

Steve