cancel
Showing results for 
Search instead for 
Did you mean: 

How to put array of source fields into 1 target?

Former Member
0 Kudos

Hi Guys!

I have a source file with following structure:

MT 1..1

Recordset 1..1

Item 0..N

Line 1..1

How to join all the Lines into 1 target field? What message mapping to use?

Thank you!

Olian

Accepted Solutions (0)

Answers (1)

Answers (1)

udo_martens
Active Contributor
0 Kudos

Hi Olian,

suppose you mean a mapping (your question is a bit poor!): for MM just take function "concat", if you use XSLT, you can handle all in one expression:

<myTarget>

<xsl:for-each select="//Item">

<xsl:value-of select="."/>

</xsl:for-each>

Regards, Udo

Former Member
0 Kudos

Hi Udo, yes, I mean mapping..

Sorry, so to make it clear: I have a source message (with structure descr above) and need to concatenate all lines into 1 target field..

How to use the concat function? There are 2 inout parameters.. Unfortunately, I was not able to find any documentasion to this. If it concats only 2 values, it is not enough, because I have a lot of lines there..

Thanks,

Olian

udo_martens
Active Contributor
0 Kudos

Hi Olian,

because of that you have to combine output of the first with input of the next and so on. The XSLT i posted is more clear.

Regards,

Udo

prateek
Active Contributor
0 Kudos

U cannot achieve this by using standard concat function.

Either create ur own UDF or go for XSL mapping as Udo has suggested.

Regards,

Prateek

Former Member
0 Kudos

Do you guys know, how to create in UDF an array as input parameter?

String[] a ?

Well, I have an array of inputs and need just 1 output.. How to achieve this?

Thanx , Olian

udo_martens
Active Contributor
0 Kudos

Olian,

sit down, smoke a cigarette and read slowly

- take first 2 elements and concat them

- take the 3rd element and concat with output of the first concat

- take the 4th element and concat with that output

and so on..

Regards,

Udo

Former Member
0 Kudos

Udo, thanx, but instead of making fun you had to tell me - use Queue in ur UDF - this ensures the input will be an array.. Concat the lines and the whole string add to resultList..

However, thanx guys!

Olain