cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping Issue

Former Member
0 Kudos

Hello,

i need some help.

Situation:

i read a flatfile with a structure like that

10 1234435 HEADER .....

20 4711 23332323 POSITIONHEADER

30 23232323 POSITION

30 23232332 POSITION

20 4741 23232323 POSITIONHEADER

30 33333333 POSITION

30 33333333 POSITION

10 ... new recordset

After converting in fileadapter i have a xml structure like that


<recordset>
<header>
<field1>value1</field1>
<field2>value2</field2>
</header>
<posheader>
<field1>myValue</field1>
<field2>value2</field2>
</posheader>
<pos>
<field1>value1</field1>
<field2>value2</field2>
</pos>
<pos>
<field1>value1</field1>
<field2>value2</field2>
</pos>
<posheader>
<field1>myValue</field1>
<field2>value2</field2>
</posheader>
<pos>
<field1>value1</field1>
<field2>value2</field2>
</pos>
<pos>
<field1>value1</field1>
<field2>value2</field2>
</pos>
</recordset>

No i need to create a IDOC segment in Messagemapping for each pos.

No problem till now. But one field of the segment has to be filled with "myValue" from the posheader.

any idea how to solf that?

regards,

robin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi robin,

if i understand your problem correctly

the xml structure has to be converted something like this

<header>

</header>

<posheader>

<pos>

</pos>

<pos>

</pos>

</posheader>

you do modify the structure, for this you require java mapping, for this you can rely upon the following blog

/people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs

After this you will be able to map easily to Idoc, other Idoc wont get multiple segments

regards

Ramesh P

Message was edited by:

Ramesh P

Answers (1)

Answers (1)

former_member189558
Contributor
0 Kudos

So you mean that field will always be populated with the same myValue as contained in the header?

If yes.. try out the useoneasMany function available in XI..

Thanks,

Himadri