cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping - concatenate issue

Former Member
0 Kudos

Dear all,

I am making a message mapping with two structures:

Source:

UF

CNF

I am creating a target message that will have a initial tag ( at the end of line if I don´t have this field ?

Thanks,

Regards,

Fernando

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

<i>How can I concatenate the fields to only one line without lost the tag control?</i>

You could use the 'constant' function(from the available list of functions in the mapping editor) to generate the tags.

<item><cUF>43</cUF><cNF>137530928</cNF></item>.

1st function concatenate:

-


1st input: <item> field

-


2nd input: const <cUF>

2nd function concatenate:

-


1st input: output of '1st function concatenate'

-


2nd input: substring(0,2)

3rd function concatenate:

-


1st input: output of '2nd function concatenate'

-


2nd input: const </cUF>

4th function concatenate:

-


1st input: output of '3rd function concatenate'

-


2nd input: const <cNF>

5th function concatenate:

-


1st input: output of '4th function concatenate'

-


2nd input: substring(2,10)

6th function concatenate:

-


1st input: output of '5th function concatenate'

-


2nd input: const </cNF>

7th functon concatenate:

-


1st input: output of '6th function concatenate'

-


2nd input:constant </item>

Hope this helps.

Regards,

Smitha.

Message was edited by:

Smitha Rao

Former Member
0 Kudos

Hi Smitha,

Thanks for your help.

For my small structures, it works well.

But I have a large structure with about 50 fields and I dont't know if I can use the mapping editor.

Do you have any idea for this case?

Regards,

Fernando

Former Member
0 Kudos

Hi,

You could use Java mapping in that case.

Take the source <cUF> and <cNF> nodes as input(arrays) and carry out the processing.

String finalString="";

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

{

finalString = "<cUF>"cUF[j]"</cUF>""<cNF>" cNF[j]+"</cNF>";

result.addValue(finalString);

}

I have assumed here, that cUF and cNF have the same occurence.

Regards,

Smitha.

Former Member
0 Kudos

Hi,

I Used your function and worked.

Thanks a lot.

Regards,

Fernando

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Wats your target structure?

Is that only has 'item' element?

Am still not clear on your requirement.

If am correct, you need <item><cUF>43</cUF><cNF>137530928</cNF></item> as your output and you have only 'item' element in the target structure.

If you need to get source element name for mapping you need to go for Java mapping. You cannot do that in graphical mapping.

Your requirement can be easily done using Java Mapping.

Regards,

P.Venkat

Former Member
0 Kudos

Hi,

Thanks for you help.

I intend to use java mapping but I don't know java very well.

Can you give me an example ?

Best Regards,

Fernando

Former Member
0 Kudos

Hi Fernando,

Concatenate UF and ( Output of Substring(0,2) of item)

then Concatenate this Output to NF

then this is Output with (Output of Substring(2,9) of Item)

Cheers

Nagesh.....