cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Items in XML string to multiple IDOC segments

Former Member
0 Kudos

I would like to map an XML tag <Text>Line1Line2Line3Line4</Text>

to an IDOC segment E1ED1TEXT . Defined as occurring 0 to 999999.

I would like to map each item separated by a tilde into a separate occurence of the IDOC text segment. Is ther anyway to repeat the mapping without duplicating the subtree.

E1ED1TEXT

Text_Id - "ZTXT"

Text_Line = Line1

E1ED1TEXT

Text_Id - "ZTXT"

Text_Line = Line2

E1ED1TEXT

Text_Id - "ZTXT"

Text_Line = Line3

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

This is only possible using UDF

mapping is like this:


Text -> UDF -> splitByValue:eachValue -> Text_Id

UDF is of context type

argument is input


String temp[] = input[0].split("~");
for(int a=0;a<temp.length;a++){
result.addValue(temp[a]);
}

Hope this helps,

Mark

Answers (2)

Answers (2)

Former Member
0 Kudos

duplicate post.

Former Member
0 Kudos

You have to use UDF and code given by Mark should work without any issues provided you do you mapping as given below..

1. Text ->UDF->E1ED1TEXT

2. Text->UDF->SplitByValue(each)-->Text_Line