cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical Message mapping complexity in SAP PI 7.31 single stack

Former Member
0 Kudos

Hi All,

I have a source structure 1..unbounded

<Material>

<row>    1....unbounded

<Mat_ID>123<Mat_ID>

<Desc><text</Desc>

<uom>EA</uom>

<plant>AB</plant>

<org>XY</org>

</row>

<row>

<Mat_ID>123<Mat_ID>

<Desc><text</Desc>

<uom>ST</uom>

<plant>CD</plant>

<org>FG</org>

</row>

<row>

<Mat_ID>123<Mat_ID>

<Desc><text</Desc>

<uom>XY</uom>

<plant>DE</plant>

<org>ZX</org>

</row>

</Material>

Target Structure

<Material>

<row>  --->  1....unbounded

<Mat_ID>123<Mat_ID>

<Desc><text</Desc>

<uomdata> ---> 0 ----unbounded

<uom>EA</uom>

<uomdata>

<uomdata>

<uom>ST</uom>

</uomdata>

<uomdata>

<uom>XY</uom>

</uomdata>

<plantdata> ----> 0 ----unbounded

<plant>AB</plant>

</plantdata>

<plantdata>

<plant>CD</plant>

</plantdata>

<plant>DE</plant>

</plantdata>

<orgdata> ---->  0 ----unbounded

<org>XY</org>

</orgdata>

<orgdata>

<org>FG</org>

</orgdata>

<orgdata>

<org>ZX</org>

</orgdata>

</row>

</Material>

How do I do message mapping (preferably graphical mapping) to achieve the target structure. The values of each elements are manipulated for easiness. There are more than one fields under each node in real scenario. Please let me know

thx

mike

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Check below mapping

1) Change the context of Id field and set the same at "Material" level

2) Mapping of Desc field

-> Change the context of Id field (same as step 1)

-> Change the context of Desc field and set the same at Material level

3) Mapping of UOMdata node and UOM field

-> Only, change the context of Id field (Same as step 1)

In a similar fashion (Same as shown in step 3) , complete mapping for Plant node

Thanks

Amit Srivastava

Former Member
0 Kudos

Beautiful..Thx...

I will try out and let you know Amit

One more request.

I have to do this mapping first and use it in receiver interfaces of ICO using an operation mapping and inbound interface as usual.

Now, I have to add 2 more inbound interfaces in the receiver interfaces and maintain order at Runtime to execute the above mapping first always and then execute the 2 additional inbound interfaces based on some condition.

The condition has to be something like this (source structure <flag> field value dependent condition)

/Material/row/flag  = 'N'       call the second inbound interface to execute a operation mapping

/Material/row/flag  = 'N'       call the third interface to execute another operation mapping

Now the complexity here is:

If the source structure is like this below

<Material>

<row>    1....unbounded

<Mat_ID>123<Mat_ID>

<Desc><text</Desc>

<uom>EA</uom>

<plant>AB</plant>

<org>XY</org>

<flag>N</flag>  -- this is the flag field for the first material

</row>

<row>

<Mat_ID>123<Mat_ID>

<Desc><text</Desc>

<flag>N</flag> -- this is the flag field for the first material again

<uom>ST</uom>

<plant>CD</plant>

<org>FG</org>

</row>

<row>

<Mat_ID>345<Mat_ID>

<Desc><text</Desc>

<flag>N</flag> --this is the flag field for the second material

<uom>XY</uom>

<plant>DE</plant>

<org>ZX</org>

</row>

and so on

</Material>

The target structure for the additional 2 inbound interface are shown below

2nd inbound interface target structure

<Material>

<Mat_ID>123</Mat_ID> 

<flag>N</flag>  - constant value 'N'

<Mat_ID>345</Mat_ID>

<flag>N</flag> - constant value 'N'

</Material>


3rd inbound interface target structure


<Material>

<Mat_ID>123</Mat_ID> 

<flag>Y</flag>  - constant value 'Y'

<Mat_ID>345</Mat_ID>

<flag>Y</flag>  - constant value 'Y'

</Material>


first question: how do I write a condition for checking the source structure <flag> field value for every unique material ?


second question: what would be the message mapping and operation mapping for the 2nd and 3rd inbound interfaces?


thx

mike




Former Member
0 Kudos

Anybody? Is the question understandable?

Former Member
0 Kudos

Hello,

Don't merge multiple questions in a single thread.

Thanks

Amit Sriavstava

Former Member
0 Kudos

sure..taking it out as separate...thx

mike

Former Member
0 Kudos

Question posted separately..thx amit

mike

Former Member
0 Kudos

Amit,

I dont think this is working. I just did for ID and it duplicated the target structure

Change the context of Id field and set the same at "Material" level  - This is the step I did and tested the message mapping. The target structure seems to be repeating for same material ID



Test:


<Material>

<row>    1....unbounded

<Mat_ID>123<Mat_ID>

--

</Material>

<Material>

<row>    1....unbounded

<Mat_ID>123<Mat_ID>

--

</Material>

When message mapping is executed,


result:




<Material>

<row>  --->  1....unbounded

<Mat_ID>123<Mat_ID>

...

</Materail>

<Material>

<row>  --->  1....unbounded

<Mat_ID>123<Mat_ID>

--

</Material>

I dont want the target structure to be repeated if the value is same which is the whole purpose of posting the question here

I didn't try Description or UOM because this itself is not working as it looks like

thx

mike

Former Member
0 Kudos

It's hard to believe because i have tested this mapping before pasting it here.

Not sure, what exactly you are doing but it should work.

Paste ur mapping screenshot here with the display queue output for target row node and Id field.

Former Member
0 Kudos

Mike -

I agree with Amit. This mapping should work as expected. May be you are not setting the context of "ID" to "Material". Alternatively, you can introduce a "removeContext" before sort.

Regards,

Sameej

Former Member
0 Kudos

Thanks Amit and Sameej. It's working perfectly. I forgot to change the context of ID

given points for your valuable help.

sorry for the mistake..

mike..

Answers (0)