cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping structure

Former Member
0 Kudos

Hi! I have a tricky one here.

I have this mapping structure :

HEADER -


> HEADER

IDOC -


> IDOC

FIELD -


> FIELD

If a certain input occurs in the FIELD element I want a new IDOC segment to appear.

for example:

(Source) (Target)

HEADER -


> HEADER

IDOC -


> IDOC

FIELD (xxx) -


> FIELD

IDOC -


> IDOC

FIELD -


> FIELD

I assume that i need to write an user-defined function?? I don't want to duplicate the subtree because if that certain input does not occur i don't want the new IDOC segment to appear.

// Thanks

Edited by: Sonny Chaos on Jan 15, 2009 10:31 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>If a certain input occurs in the FIELD element I want a new IDOC segment to appear.

there is nothing tricky in this one

just write a UDF map field - segment

and your UDF will create the segment when a value of field will be.. something

it's a common requirement

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi, thanks for your answer...could you explain a little about UDF map field? and what should i write there?

thanks

MichalKrawczyk
Active Contributor
0 Kudos

hi,

depends on what you need to achive

if you want to create the segment you just need to connect field - segment

and use removecontext function and it will create the new segment

each time the field is not empty

Regards,

Michal KRawczyk

Former Member
0 Kudos

HI again, i have tried the field --- removecontext -


segment but it does not duplicate the segment. any ideas why? the thing is that for example: if field contains xx1 I don't want the segment to duplicate but if contains xx2 i want it to duplicate...does it make sense?

thanks

SudhirT
Active Contributor
0 Kudos

Hi ,

Try like this

for(int i =0;i<field.length;i++)
{
 if(field<i>.equals("XX2"))
{ result.addValue("1");
  result.addValue("2");
}
}

Here source field will be "FIELD" and target will be the Idoc segment you want to apply duplicate logic.

Thanks!