cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping problem on different levels. (IDOC) to XML

Former Member
0 Kudos

I am having a mapping issue with a multi segment IDOC. It seems that it should be pretty straight forward but I am struggling. I have looked at some pretty good documentation but it still doesn't seem to help. The IDOC segments deal with text lines in SAP. The text identifier is at a higher level and the text lines are a level below the text identifier. I am writing these records to XML . Both of these are at the same level. I need to combine the text identifier from the higher level to to each text line in the XML.

Here is my source file. It contains two different types of text identifiers (TDID)

<E1TXTH8 SEGMENT="1">

<TDID>0012</TDID>

<TDSPRAS>E</TDSPRAS>

<E1TXTP8 SEGMENT="1">

<TDLINE>This is line 1 of TDID 0012</TDLINE>

</E1TXTP8>

<E1TXTP8 SEGMENT="1">

<TDLINE>This is line 2 of TDID 0012</TDLINE>

</E1TXTP8>

<E1TXTP8 SEGMENT="1">

<TDLINE>This is line 3 of TDID 0012</TDLINE>

</E1TXTP8>

</E1TXTH8>

<E1TXTH8 SEGMENT="1">

<TDID>Z110</TDID>

<TDSPRAS>E</TDSPRAS>

<E1TXTP8 SEGMENT="1">

<TDLINE>This is line 1 of TDID Z110</TDLINE>

</E1TXTP8>

<E1TXTP8 SEGMENT="1">

<TDLINE>This is line 2 of TDID Z110.</TDLINE>

</E1TXTP8>

</E1TXTH8>

I wand this to map so that I see the following results:

<TDID>0012</TDID>

<TDLINE>This is line 1 of TDID 0012</TDLINE>

</access>

<access>

<TDID>0012</TDID>

<TDLINE>This is line 2 of TDID 0012</TDLINE>

</access>

<access>

<TDID>0012</TDID>

<TDLINE>This is line 3 of TDID 0012</TDLINE>

</access>

<access>

<TDID>Z110</TDID>

<TDLINE>This is line 1 of TDID Z110</TDLINE>

</access>

<access>

<TDID>Z110</TDID>

<TDLINE>This is line 2 of TDID Z110</TDLINE>

</access>

</MDB_tblshippingtext>

</InsertStatement_ShippingText>

So far I have been unsuccessful. I am mapping the access element to the lower level segment E1TXTP8. This gives me all of the text lines but the TDID is not filled in properly.

If I map the access element to the highler level E1TXTH8 then I do not get all of my text lines from the lower level. I have looked at the document "Replication of Nodes using the graphical tool mapper" but I still don't seem to understand my problem.

Any help is appreciated.

Thanks,

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member214364
Active Contributor
0 Kudos

Hi Neela,

I have uploaded Mapping pictures(Access node Mapping,TDID field Mapping,TDLINE Field Mapping).

http://www.flickr.com/photos/14144840@N02

In Access node Mapping You can use removeContexts node function as shown in Pic or without using removeContexts function Change Context to parent of E1TXTH8 node (How to Change Context: Right click on TDLINE in Data flow editor Context->select parent of E1TXTH8 node)

In TDID field Mapping useOneAsMany node function and change contexts of 2nd and 3rd inputs of this function to E1TXTH8 as shown in Pic.

Please let me know if you have any issues.

Thanks,

Jag

Former Member
0 Kudos

Hi !

Use the "UseOneAsMany" standard mapping function to have many "TDID" tags, one for each "TDLINE" in the target message structure.

Regards,

Matias