Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with Context in mapping

Hi.

I have a big problem with my mapping.

My input look like this.:

- <Rec>

- <raw>

<Rec_type>B</Rec_type>

<Record_data>0000340H150000006269 N2007020105070000727001000009000540006599350000000000</Record_data>

</raw>

- <raw>

<Rec_type>C</Rec_type>

<Record_data>0000350H1500000062690000107074030000610000000060800000004910001080 80620000727001</Record_data>

</raw>

- <raw>

<Rec_type>D</Rec_type>

<Record_data>0000360H15000000626900001070740000107079030000610000000060800000004920000000727001</Record_data>

</raw>

- <raw>

<Rec_type>D</Rec_type>

<Record_data>0000370H15000000626900001070740000107432030000000000000000000000000000000000727001</Record_data>

</raw>

- <raw>

<Rec_type>C</Rec_type>

<Record_data>0000380H1500000062690000115008010004995000000499900000041630001610 83470000727001</Record_data>

</raw>

- <raw>

<Rec_type>C</Rec_type>

<Record_data>0000390H1500000062690000115008050003997000000400300000033320001660 83470000727001</Record_data>

</raw>

- <raw>

<Rec_type>C</Rec_type>

<Record_data>0000400H1500000062690000115008030002996000000300000000024980001640 83470000727002</Record_data>

</raw>

- <raw>

<Rec_type>C</Rec_type>

<Record_data>0000410H1500000062690000115008040003995000000399900000033300001630 83470000727002</Record_data>

</raw>

- <raw>

<Rec_type>C</Rec_type>

<Record_data>0000420H1500000062690000115483010004850000000480100000040250000300 83110000727002</Record_data>

</raw>

- <raw>

<Rec_type>D</Rec_type>

<Record_data>0000430H15000000626900001154830000107432010000000000000000000000000000000000727002</Record_data>

</raw>

- <raw>

<Rec_type>D</Rec_type>

<Record_data>0000440H15000000626900001154830000107079010001453000000144000000011710000000727002</Record_data>

</raw>

- <raw>

<Rec_type>D</Rec_type>

<Record_data>0000450H15000000626900001154830000115124010003397000000336100000028590000000727002</Record_data>

</raw>

- <raw>

<Rec_type>C</Rec_type>

<Record_data>0000460H1500000062690000115502020004012000000399900000029470001240 73570000727001</Record_data>

</raw>

-

-

-

My target is an iDoc with this structure.:

IDOC

- E1OILT1

- - xxxx

- - xxxx

-

-

- - E1OILT2

- - E1OILT2

- - E1OILT2

- - E1OILT3

- - E1OILT3

For each B-record I'm going to produce an iDoc.

My problem is that all "C"-records shall into the first E1OILT3-segment and

all "D"-records shall into the second E1OILT3-segment.

It works well with the C-record but not with the D-records.

D is depend on C, but C dont need to have a D-record.

C could also have several D-records.

Don't know if I explained this good enough but i hope someone could give me an hint whats wrong with my context.

Thanks

Former Member
Former Member replied

then i think you need to write some JAVA code to do this.

Create a User-Defined Function.

and start using some of the ResultList Methods.

check the blogs to how to do this.

it will take you some time beacuse you need to understand the concept of Context if you don't know already.

there is some methods like "addValue" that create a new Value.

Regards,

Roi Grosfeld

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question