cancel
Showing results for 
Search instead for 
Did you mean: 

Need Message Mapping or UDF for my Question.

former_member191435
Contributor
0 Kudos

Hi,

My input structure ha

<product>

<finishing_Product>

<Component_Product>

</Product>

My output structure

<item>

<code>

</item>

My input file has

finishing_prouct = A91 and component_product = B91

finishing_prouct = A91 and component_product = B92

finishing_prouct = A92 and component_product = B81

finishing_prouct = A91 and component_product = B93

but i need output has

<item>

<code> A91</code>

</item>

<item>

<code>b91</code>

</item>

<item>

<code>b92</code>

</item>

<item>

<code>b93</code>

</item>

<item>

<code>A92</code>

</item>

<item>

<code>b81></code>

</item>

i.e. first i need to sort Finishing product then i need to display every component product in that finishing product.Please tell me how would we do this in message mapping.

Thanks,

Enivas.

Accepted Solutions (1)

Accepted Solutions (1)

jyothi_anagani
Active Contributor
0 Kudos

Hi Nivas,

Use remove context and SplitByValue(Value Change) , collapseContext, node functions . you can achieve this functionality very easily..

Thanks.

former_member191435
Contributor
0 Kudos

Hi,

Thanks for all ur replies.

But my target structure is different.

Please look at my target message its is different.

I am unable to get the required output. when am trying. Please help me on this isssue.

Advance thanks for your valuable time.

Sreenivas.

Edited by: enivas on Aug 20, 2010 12:55 PM

Former Member
0 Kudos

Sree I have given some screen shots & UDF code... so it and let us know if it works for you.

Answers (2)

Answers (2)

Former Member
0 Kudos

Here is the UDF Code and mapping steps screen shots with test result..

UDF Link: http://www.flickr.com/photos/23639237@N02/4909850131/sizes/l/in/photostream/

Item mapping: http://www.flickr.com/photos/23639237@N02/4909853307/sizes/l/in/photostream/

Code mapping: http://www.flickr.com/photos/23639237@N02/4910456070/sizes/l/in/photostream/

Test results: http://www.flickr.com/photos/23639237@N02/4909857153/sizes/l/in/photostream/

int count1 = 0;

for(int i = 0; i < a.length; i++)
{
result.addValue(a<i>);
	 for(int j = count1; j < b.length; j++)
	 {
	       if(b[j].equals(ResultList.CC))
	       {
		 count1 = j + 1;
		 break;
	       }
	 result.addValue(b[j]);
	 }
}

Shabarish_Nair
Active Contributor
0 Kudos

you will have to use the sortbyKey Standard function to help you out.

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

Just do a search in SDN to find how that function has been used for similar scenarios