cancel
Showing results for 
Search instead for 
Did you mean: 

Reg mapping issue

Former Member
0 Kudos

I had a query that

ET1

TDID

ET2

TDLINE Very

ET2

TDLINE Good

ET2

TDLINE Morning

For this structure if TDID = 09 then it all TDLINE fileds data should be passed to target field u201CTEXTu201D in manner u201D Very Good Morningu201D

Here ET1 is Header and TDID and ET2s are at equal level hirarchy

Regards

Vivek

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You need to concatenate all TDLINE values and use condition if TDID = 09 then map all concatenated values of TDLINE to TEXT.

Former Member
0 Kudos

Hi ,

Sorry to mention..

ET2 is 1-1 segment..

and it is replicating based on occurance..

regards

vivek

Former Member
0 Kudos

> ET2 is 1-1 segment..

>

> and it is replicating based on occurance..

When ET2 is 1-1 then how it is replicating based on what occurrance. It's good if you provide the actual xml structure with occurrance.

Anyway, in order to get your desired result you have to use below UDF.

While creating the UDF set Cache as "Queue"

String output = "" ;

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

output =  output + a<i>;        

if ( i != a.length - 1 )
{       
  output  = output + " " ;        
}
}
result.addValue(output);

After that do the mapping as shown below.

TDLINE --->RemoveContext--->UDF--->(Put the condition if TDID = 09 Then map the output of UDF to text)-->TEXT.