cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue

Former Member
0 Kudos

Hi,

<br>

i have the following mapping;

<br>

<img src="http://img14.imgspot.com/u/07/149/03/Screencapture18.jpg">

<br>

<br>

with following for SEG02 segment' mapping;

<br>

<img src="http://img14.imgspot.com/u/07/149/03/Screencapture19.jpg">

<br>

<br>

problem is that the result is correct for the first MT_TestSale2 output, but following MT_TestSale2 outputs has no SEG02 segments.

<br>

<img src="http://img14.imgspot.com/u/07/149/03/Screencapture20.jpg">

<br>

<br>

Can any1 please help on clarifing what is wrong? Why the last 2 MT_TestSale2 are not having SEG02?

Any help greatly appreciated!

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try this using User Defined Function :

SH02RemoveContext-\

SL03RemoveContext-\UDF1--SEG02

SH03RemoveContext--/

SL04RemoveContext-/

SH02RemoveContext-\

SL03RemoveContext-\UDF1SplitByValue[EachValue]-f21

SH03RemoveContext--/

SL04RemoveContext-/

SH02RemoveContext-\

SL03RemoveContext-\UDF2SplitByValue[EachValue]-f22

SH03RemoveContext--/

SL04RemoveContext-/

There is a small difference between UDF1 & UDF2

UDF1

for(int i = 0 ; i< a.length ; i++)

{

for(int j = 0 ; j < b.length ; j++)

{

if(a<b>[</b>i<b>]</b>.equals(b[j]) && c<b>[</b>i<b>]</b>.equals(d[j]))

{

result.addValue(b[j]);

}

}

result.addContextChange();

}

UDF2

for(int i = 0 ; i< a.length ; i++)

{

for(int j = 0 ; j < b.length ; j++)

{

if(a<b>[</b>i<b>]</b>.equals(b[j]) && c<b>[</b>i<b>]</b>.equals(d[j]))

{

<b> result.addValue(d[j]);</b>

}

}

result.addContextChange();

}

Thanks,

Maheshwari

Former Member
0 Kudos

Hi Maheshwari,

thank you very much for your help. Unfortunately the UDFs didn't compile correctly.

The error for UDF1 is:

<i>Source code has syntax error: /usr/sap/BXD/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map180136c00f0811dcbe692600831423e0/source/com/sap/xi/tf/_MM_TestBindSplitResult3_.java:146: illegal start of expression if(a<b>[</b>i<b>]</b>.equals(b[j]) && c<b>[</b>i<b>]</b>.equals(d[j])) ^ /usr/sap/BXD/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map180136c00f0811dcbe692600831423e0/source/com/sap/xi/tf/_MM_TestBindSplitResult3_.java:150: ']' expected } ^ 2 errors </i>

and the error for UDF2 is:

Source code has syntax error: <i>/usr/sap/BXD/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map336934800f0811dc84832600831423e0/source/com/sap/xi/tf/_MM_TestBindSplitResult3_.java:145: illegal start of expression if(a<b>[</b>i<b>]</b>.equals(b[j]) && c<b>[</b>i<b>]</b>.equals(d[j])) ^ /usr/sap/BXD/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map336934800f0811dc84832600831423e0/source/com/sap/xi/tf/_MM_TestBindSplitResult3_.java:149: ']' expected } ^ 2 errors </i>

can you please tell me how can i fix these?

Thanks.

Okan

Former Member
0 Kudos

Hi Maheshwari,

i got UDFs to work. (problem was some html character came along when i copy-pasted).

Unfortunately still not correct result. SEG02 segment is missing on second output.

<img src="http://www.2and2.net/files/465e17d97c08f.jpg">

do you know how can i fix it?

thanks, regards

Former Member
0 Kudos

Thank you very much! Solved the problem! Points awarded!

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

u mean to say value of f21 and f22 is same as its corresponding fl1 and fl2?

plz make this clear?

Thanks,

Maheshwari.

Former Member
0 Kudos

Hi Maheshwari, thanks for your response,

i know its confusing, i should have found a better way of explaining this, sorry.

MT_TestSale2 (Create one for each header msg)

f11 mapped to SH02

f12 mapped to SH03

SEG02 (Where SL03 = SH02 AND SL04 = SH03)

f21 mapped to SL03

f22 mapped to SL04

does it make sense now?

Former Member
0 Kudos

Hi Okan,

could you please explain the logic you are using.

you are having unbounded header as well as unbounded line items.

and you are trying to create the target node with same occurance as the header node in the source message .

and how do you plant to map.

I mean suppose you have 2 header nodes and 3 line item nodes in the source message.

what target message you are expecting out of that.

Regards

Pushkar

Former Member
0 Kudos

hi Pushkar, you are right, i have to explain better.

I need to group line items to header items. So i need result outputs as with same amount of header.

And lineitems should be grouped below each one of these headers.

For example, lineitems and headers should be grouped where LineItem-SL03 = Header-SH02 AND LineItem-SL04 = Header-SH03.

so lets say i have the following as input

3 header msgs and 7 lineitem msgs.

MT_Header (1st)

SH02 = A

SH03 = B

MT_Header (2nd)

SH02 = C

SH03 = D

MT_Header (3rd)

SH02 = C

SH03 = E

MT_LineItem (1st)

SL03 = C

SL04 = D

MT_LineItem (2nd)

SL03 = A

SL04 = B

MT_LineItem (3rd)

SL03 = A

SL04 = B

MT_LineItem (4th)

SL03 = C

SL04 = E

MT_LineItem (5th)

SL03 = C

SL04 = D

MT_LineItem (6th)

SL03 = C

SL04 = E

MT_LineItem (7th)

SL03 = C

SL04 = D

this should be converted to 3 MT_TestSale2 msgs as following;

MT_TestSale2 (1st)

fl1 = A

fl2 = B

SEG02 (this one built by LineItem-2nd)

f21 = A

f22 = B

SEG02 (this one built by LineItem-3rd)

f21 = A

f22 = B

MT_TestSale2 (2nd)

fl1 = C

fl2 = D

SEG02 (this one built by LineItem-1st)

f21 = C

f22 = D

SEG02 (this one built by LineItem-5th)

f21 = C

f22 = D

SEG02 (this one built by LineItem-7th)

f21 = C

f22 = D

MT_TestSale2 (3rd)

fl1 = C

fl2 = E

SEG02 (this one built by LineItem-4th)

f21 = C

f22 = E

SEG02 (this one built by LineItem-6th)

f21 = C

f22 = E

sorry for the confusion, i tried to simplfy but the case is a bit complicated.

Thanks for the help.

Former Member
0 Kudos

Hi,

Instead of putting if condition, use node function createlf to create the target node SEG02 .

Just remove If condition and insert "createlf" instead of 'if'.

It works

Regards

Former Member
0 Kudos

Hi Pushkar,

i have tried by placing createIf instead, same result. First result msg has correct SEG02s, but the following ones hasn't.

Any other ideas?

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

have a look at this blog:

/people/venkat.donela/blog/2005/06/09/introduction-to-queues-in-message-mapping

and check the queues in your output on SEG02 level and item level

they need to have correct context changes

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi Michal,

i've read thru the blog you've mentioned,

can you please be a bit specific? I have actually achieved this by bpm but am required to achieve this grouping by 1 mapping only due to performance problems on volume testing.

It shouldn't be too difficult to group these right?